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

Commit db10aec6 authored by Toshiya Ikenaga's avatar Toshiya Ikenaga Committed by Hall Liu
Browse files

Fix audio route when undocked during video call

When user undocks during video call, audio route is set to earpiece
improperly. Fix to set to speaker in that case.

Test: manual - undocked during video call
Bug: 29529008
Change-Id: I78ef76af67400cf07d437581612eae5d78142abd
parent fca12b76
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1529,7 +1529,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;