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

Commit b38e7a4f authored by Ravi Nagarajan's avatar Ravi Nagarajan Committed by Matthew Xie
Browse files

Listen for phone state on connect instead of SLC

Phone state listener changed to start on connect. This gaurantees
that the CIND response as part of SLC reflects the right indicator
values
bug 17020870

Change-Id: I47989643600edfa4d4e422998c3a644a7f7556b9
parent 3819cf41
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -726,6 +726,11 @@ final class HeadsetStateMachine extends StateMachine {
        public void enter() {
            log("Enter Connected: " + getCurrentMessage().what +
                           ", size: " + mConnectedDevicesList.size());
            // start phone state listener here so that the CIND response as part of SLC can be
            // responded to, correctly.
            // we may enter Connected from Disconnected/Pending/AudioOn. listenForPhoneState
            // internally handles multiple calls to start listen
            mPhoneState.listenForPhoneState(true);
        }

        @Override
@@ -1085,11 +1090,6 @@ final class HeadsetStateMachine extends StateMachine {
        private void processSlcConnected() {
            if (mPhoneProxy != null) {
                try {
                    // start phone state listener here, instead of on disconnected exit()
                    // On BT off, exitting SM sends a SM exit() call which incorrectly forces
                    // a listenForPhoneState(true).
                    // Additionally, no indicator updates should be sent prior to SLC setup
                    mPhoneState.listenForPhoneState(true);
                    mPhoneProxy.queryPhoneState();
                } catch (RemoteException e) {
                    Log.e(TAG, Log.getStackTraceString(new Throwable()));
@@ -1514,11 +1514,6 @@ final class HeadsetStateMachine extends StateMachine {
        private void processSlcConnected() {
            if (mPhoneProxy != null) {
                try {
                    // start phone state listener here, instead of on disconnected exit()
                    // On BT off, exitting SM sends a SM exit() call which incorrectly forces
                    // a listenForPhoneState(true).
                    // Additionally, no indicator updates should be sent prior to SLC setup
                    mPhoneState.listenForPhoneState(true);
                    mPhoneProxy.queryPhoneState();
                } catch (RemoteException e) {
                    Log.e(TAG, Log.getStackTraceString(new Throwable()));