aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaganath Kanakkassery <jaganath.k@samsung.com>2012-05-02 17:06:30 +0530
committerJohan Hedberg <johan.hedberg@intel.com>2012-05-02 14:40:32 +0300
commit2aa45c5fc5c7b12edc38417b99dfec1ebe929837 (patch)
tree83eb95074871a5782d6f9b3c1d926610e98d91e8
parenta521540ca0f807b51ea881d5de7fb60bba592ffa (diff)
downloadbluez-2aa45c5fc5c7b12edc38417b99dfec1ebe929837.tar.gz
bluez-2aa45c5fc5c7b12edc38417b99dfec1ebe929837.tar.xz
bluez-2aa45c5fc5c7b12edc38417b99dfec1ebe929837.zip
audio: Reset hfp and hs handle before connection
When bluez initiates headset connection hfp and hs handle is saved each time when initiating connection. So at some point if hf service is removed in remote headset then bluez connects to hs service. But because of previously stored hfp handle bluez thinks that connection made to hs service is hfp connection and waits for at commands. Eventually bluez connection state will be incorrectly set.
-rw-r--r--audio/headset.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c
index f15951dd..fb10c363 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1464,9 +1464,11 @@ static int headset_set_channel(struct headset *headset,
if (svc == HANDSFREE_SVCLASS_ID) {
headset->hfp_handle = record->handle;
+ headset->hsp_handle = 0;
DBG("Discovered Handsfree service on channel %d", ch);
} else {
headset->hsp_handle = record->handle;
+ headset->hfp_handle = 0;
DBG("Discovered Headset service on channel %d", ch);
}