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.
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);
}