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

Commit e06f2b11 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

Change-Id: I9e4e96b91cabb52faf2d35ebf9bc8d24d161242f
parents fb0b1a4b db10aec6
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;