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

Commit 8af2f5b1 authored by Toshiya Ikenaga's avatar Toshiya Ikenaga Committed by android-build-merger
Browse files

Fix audio route when undocked during video call am: db10aec6

am: e06f2b11

Change-Id: I6df05930a1f6f18e18b93f8c50dcb0cf11e2d116
parents 1894dcf7 e06f2b11
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1547,7 +1547,15 @@ public class CallAudioRouteStateMachine extends StateMachine {
    }

    private int calculateBaselineRouteMessage(boolean isExplicitUserRequest) {
        if ((mAvailableRoutes & ROUTE_EARPIECE) != 0) {
        boolean isSkipEarpiece = false;
        if (!isExplicitUserRequest) {
            synchronized (mLock) {
                // Check video calls to skip earpiece since the baseline for video
                // calls should be the speakerphone route
                isSkipEarpiece = mCallsManager.hasVideoCall();
            }
        }
        if ((mAvailableRoutes & ROUTE_EARPIECE) != 0 && !isSkipEarpiece) {
            return isExplicitUserRequest ? USER_SWITCH_EARPIECE : SWITCH_EARPIECE;
        } else if ((mAvailableRoutes & ROUTE_WIRED_HEADSET) != 0) {
            return isExplicitUserRequest ? USER_SWITCH_HEADSET : SWITCH_HEADSET;