Commit acc99899 authored by Mallikarjuna GB's avatar Mallikarjuna GB Committed by Andre Eisenbach
Browse files

Handle SLC in MultiHFPending state

Use case:
Connect 2 headsets one after another in quick
succession.

Failure:
SLC for first headset is not happening.

Root cause:
SLC for first headset is not handled when second
headset is connecting.

Fix:
Add handling for SLC event for HS1 in MultiHFPending state.

Change-Id: If0c2553c28e233bea4622fca10c94fddd913afa7
parent 6455f278
......@@ -1545,7 +1545,7 @@ final class HeadsetStateMachine extends StateMachine {
} else {
Log.e(TAG, "Handsfree phone proxy null for query phone state");
}
}
}
private void processIntentScoVolume(Intent intent, BluetoothDevice device) {
int volumeValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0);
......@@ -1920,6 +1920,9 @@ final class HeadsetStateMachine extends StateMachine {
}
}
break;
case HeadsetHalConstants.CONNECTION_STATE_SLC_CONNECTED:
processSlcConnected();
break;
case HeadsetHalConstants.CONNECTION_STATE_CONNECTING:
if (mConnectedDevicesList.contains(device)) {
Log.e(TAG, "current device tries to connect back");
......@@ -1998,6 +2001,19 @@ final class HeadsetStateMachine extends StateMachine {
}
}
private void processSlcConnected() {
if (mPhoneProxy != null) {
try {
mPhoneProxy.queryPhoneState();
} catch (RemoteException e) {
Log.e(TAG, Log.getStackTraceString(new Throwable()));
}
} else {
Log.e(TAG, "Handsfree phone proxy null for query phone state");
}
}
private void processMultiHFConnected(BluetoothDevice device) {
log("MultiHFPending state: processMultiHFConnected");
if (mActiveScoDevice != null && mActiveScoDevice.equals(device)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment