OSDN Git Service

audio: Reset hfp and hs handle before connection
authorJaganath Kanakkassery <jaganath.k@samsung.com>
Wed, 2 May 2012 11:36:30 +0000 (17:06 +0530)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 2 May 2012 11:40:32 +0000 (14:40 +0300)
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.

audio/headset.c

index f15951d..fb10c36 100644 (file)
@@ -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);
        }