diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-12-11 14:39:30 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-12-11 14:39:30 +0000 |
commit | d3a05810c6855dbd8664b29a984726d80f42d3dd (patch) | |
tree | cb91b3a0969b342b5a0f8f317eda9edf66a75173 /audio/manager.c | |
parent | 720c7262b6d88d296d15de907cd21ad3b30d9aa0 (diff) |
Fix connecting to hfp headset. (Patch from fdalleau)
Diffstat (limited to 'audio/manager.c')
-rw-r--r-- | audio/manager.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/audio/manager.c b/audio/manager.c index 507f60ac..cfadec47 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -108,6 +108,7 @@ static GIOChannel *hs_server = NULL; static GIOChannel *hf_server = NULL; static const struct enabled_interfaces *enabled; +static gboolean enable_hfp = FALSE; static void get_next_record(struct audio_sdp_data *data); static DBusHandlerResult get_handles(const char *uuid, @@ -254,6 +255,7 @@ static void handle_record(sdp_record_t *record, struct device *device) headset_update(device, record, uuid16); else device->headset = headset_init(device, + enable_hfp, record, uuid16); break; case HEADSET_AGW_SVCLASS_ID: @@ -265,6 +267,7 @@ static void handle_record(sdp_record_t *record, struct device *device) headset_update(device, record, uuid16); else device->headset = headset_init(device, + enable_hfp, record, uuid16); break; case HANDSFREE_AGW_SVCLASS_ID: @@ -645,7 +648,7 @@ struct device *manager_device_connected(bdaddr_t *bda, const char *uuid) if (device->headset) return device; - device->headset = headset_init(device, NULL, 0); + device->headset = headset_init(device, enable_hfp, NULL, 0); if (!device->headset) return NULL; @@ -1070,7 +1073,7 @@ static void parse_stored_devices(char *key, char *value, void *data) bacpy(&device->store, src); if (enabled->headset && strstr(value, "headset")) - device->headset = headset_init(device, NULL, 0); + device->headset = headset_init(device, enable_hfp, NULL, 0); if (enabled->sink && strstr(value, "sink")) device->sink = sink_init(device); if (enabled->control && strstr(value, "control")) @@ -1561,6 +1564,8 @@ static int headset_server_init(DBusConnection *conn, gboolean no_hfp) if (no_hfp) return 0; + enable_hfp = TRUE; + chan = DEFAULT_HF_AG_CHANNEL; hf_server = server_socket(&chan); |