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

Commit 8c7a0071 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Turn off mWasOnSpeaker if user explicitly leaves speakerphone" into nyc-dev

am: 209175a2

* commit '209175a2':
  Turn off mWasOnSpeaker if user explicitly leaves speakerphone

Change-Id: I502f0d40980f73a0180c60d3c1300506c00d60db
parents 17da6d44 209175a2
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -782,24 +782,30 @@ public class CallAudioRouteStateMachine extends StateMachine {
                return HANDLED;
            }
            switch(msg.what) {
                case SWITCH_EARPIECE:
                case USER_SWITCH_EARPIECE:
                    mWasOnSpeaker = false;
                    // fall through
                case SWITCH_EARPIECE:
                    if ((mAvailableRoutes & ROUTE_EARPIECE) != 0) {
                        transitionTo(mActiveEarpieceRoute);
                    } else {
                        Log.w(this, "Ignoring switch to earpiece command. Not available.");
                    }
                    return HANDLED;
                case SWITCH_BLUETOOTH:
                case USER_SWITCH_BLUETOOTH:
                    mWasOnSpeaker = false;
                    // fall through
                case SWITCH_BLUETOOTH:
                    if ((mAvailableRoutes & ROUTE_BLUETOOTH) != 0) {
                        transitionTo(mActiveBluetoothRoute);
                    } else {
                        Log.w(this, "Ignoring switch to bluetooth command. Not available.");
                    }
                    return HANDLED;
                case SWITCH_HEADSET:
                case USER_SWITCH_HEADSET:
                    mWasOnSpeaker = false;
                    // fall through
                case SWITCH_HEADSET:
                    if ((mAvailableRoutes & ROUTE_WIRED_HEADSET) != 0) {
                        transitionTo(mActiveHeadsetRoute);
                    } else {