Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e80c5aea 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 f6bea2e3
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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)) {