diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-07-07 16:10:16 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-07-07 16:10:16 +0300 |
commit | 5da3f2e2bbd420a2cdb40f8b36abfaf19fb228aa (patch) | |
tree | 9634ab9e4d165629415181f8723ba1a8f6f8362b /audio | |
parent | 83f66b9f40a214efd06ed4ea30841c580377327c (diff) | |
download | bluez-5da3f2e2bbd420a2cdb40f8b36abfaf19fb228aa.tar.gz |
Fix inband ring setting to be per-headset
Inband ringing can be enabled or disabled for each connection separately
(using the +BSIR unsolicited result code), so only set the default from
the global setting when the headset becomes connected.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/headset.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/audio/headset.c b/audio/headset.c index 48a66b9ab..2c852d1ab 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -154,6 +154,7 @@ struct headset { gboolean cme_enabled; gboolean cwa_enabled; gboolean pending_ring; + gboolean inband_ring; gboolean nrec; gboolean nrec_req; @@ -2471,11 +2472,15 @@ void headset_set_state(struct audio_device *dev, headset_state_t state) AUDIO_HEADSET_INTERFACE, "State", DBUS_TYPE_STRING, &state_str); if (hs->state < state) { - value = TRUE; + if (ag.features & AG_FEATURE_INBAND_RINGTONE) + hs->inband_ring = TRUE; + else + hs->inband_ring = FALSE; g_dbus_emit_signal(dev->conn, dev->path, AUDIO_HEADSET_INTERFACE, "Connected", DBUS_TYPE_INVALID); + value = TRUE; emit_property_changed(dev->conn, dev->path, AUDIO_HEADSET_INTERFACE, "Connected", @@ -2699,15 +2704,15 @@ int telephony_incoming_call_ind(const char *number, int type) /* With HSP 1.2 the RING messages should *not* be sent if inband * ringtone is being used */ - if (!hs->hfp_active && (ag.features & AG_FEATURE_INBAND_RINGTONE)) + if (!hs->hfp_active && hs->inband_ring) return 0; g_free(ag.number); ag.number = g_strdup(number); ag.number_type = type; - if (ag.features & AG_FEATURE_INBAND_RINGTONE && hs->hfp_active && - hs->state != HEADSET_STATE_PLAYING) { + if (hs->inband_ring && hs->hfp_active && + hs->state != HEADSET_STATE_PLAYING) { hs->pending_ring = TRUE; return 0; } |