~ubuntu-branches/ubuntu/oneiric/bluez/oneiric-201105191013

« back to all changes in this revision

Viewing changes to audio/telephony-maemo5.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-12-20 16:08:47 UTC
  • mfrom: (1.1.24 upstream)
  • Revision ID: james.westby@ubuntu.com-20101220160847-wc1907sgz6x3vjz7
Tags: 4.82-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
#include "log.h"
40
40
#include "telephony.h"
 
41
#include "error.h"
41
42
 
42
43
/* SSC D-Bus definitions */
43
44
#define SSC_DBUS_NAME  "com.nokia.phone.SSC"
209
210
/* Supported set of call hold operations */
210
211
static const char *chld_str = "0,1,1x,2,2x,3,4";
211
212
 
212
 
/* Response and hold state
213
 
 * -1 = none
214
 
 *  0 = incoming call is put on hold in the AG
215
 
 *  1 = held incoming call is accepted in the AG
216
 
 *  2 = held incoming call is rejected in the AG
217
 
 */
218
 
static int response_and_hold = -1;
219
 
 
220
213
static char *last_dialed_number = NULL;
221
214
 
222
215
/* Timer for tracking call creation requests */
516
509
 
517
510
void telephony_response_and_hold_req(void *telephony_device, int rh)
518
511
{
519
 
        response_and_hold = rh;
520
 
 
521
 
        telephony_response_and_hold_ind(response_and_hold);
522
 
 
523
 
        telephony_response_and_hold_rsp(telephony_device, CME_ERROR_NONE);
 
512
        telephony_response_and_hold_rsp(telephony_device,
 
513
                                                CME_ERROR_NOT_SUPPORTED);
524
514
}
525
515
 
526
516
void telephony_last_dialed_number_req(void *telephony_device)
1884
1874
        }
1885
1875
}
1886
1876
 
1887
 
static inline DBusMessage *invalid_args(DBusMessage *msg)
1888
 
{
1889
 
        return g_dbus_create_error(msg,"org.bluez.Error.InvalidArguments",
1890
 
                                        "Invalid arguments in method call");
1891
 
}
1892
 
 
1893
1877
static uint32_t get_callflag(const char *callerid_setting)
1894
1878
{
1895
1879
        if (callerid_setting != NULL) {
1954
1938
        if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING,
1955
1939
                                                &callerid_setting,
1956
1940
                                                DBUS_TYPE_INVALID) == FALSE)
1957
 
                return invalid_args(msg);
 
1941
                return btd_error_invalid_args(msg);
1958
1942
 
1959
1943
        if (g_str_equal(callerid_setting, "allowed") ||
1960
1944
                        g_str_equal(callerid_setting, "restricted") ||
1968
1952
 
1969
1953
        error("telephony-maemo: invalid argument %s for method call"
1970
1954
                                        " SetCallerId", callerid_setting);
1971
 
                return invalid_args(msg);
 
1955
                return btd_error_invalid_args(msg);
1972
1956
}
1973
1957
 
1974
1958
static GDBusMethodTable telephony_maemo_methods[] = {
2097
2081
        DBG("telephony-maemo registering %s interface on path %s",
2098
2082
                        TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
2099
2083
 
2100
 
        telephony_ready_ind(features, maemo_indicators, response_and_hold,
 
2084
        telephony_ready_ind(features, maemo_indicators, BTRH_NOT_SUPPORTED,
2101
2085
                                                                chld_str);
2102
2086
#if 0 /* Disable hal */
2103
2087
        if (send_method_call("org.freedesktop.Hal",
2122
2106
 
2123
2107
        dbus_connection_unref(connection);
2124
2108
        connection = NULL;
 
2109
 
 
2110
        telephony_deinit();
2125
2111
}