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

Commit 95cff477 authored by Ravindra's avatar Ravindra Committed by Gerrit - the friendly Code Review server
Browse files

Fix to update the UI on wired headset state change

When there is a change in the state of wired headstate update
the change to InCallUI to display the device list correctly.

CRs-Fixed: 767097

Change-Id: Ic285f52ab57bb423a8dc3b62c56a95c1fb2a1806
parent 10b63ea1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ final class CallAudioManager extends CallsManagerListenerBase
    @Override
    public void onWiredHeadsetPluggedInChanged(boolean oldIsPluggedIn, boolean newIsPluggedIn) {
        // This can happen even when there are no calls and we don't have focus.
        int newRoute;
        if (!hasFocus()) {
            return;
        }
@@ -149,7 +150,7 @@ final class CallAudioManager extends CallsManagerListenerBase
        Log.d(this,"isBluetoothAudioOn(): "+isBluetoothAudioOn());

        if (!isBluetoothAudioOn()) {
            int newRoute = AudioState.ROUTE_EARPIECE;
            newRoute = AudioState.ROUTE_EARPIECE;
            if (newIsPluggedIn) {
                newRoute = AudioState.ROUTE_WIRED_HEADSET;
            } else if (mWasSpeakerOn) {
@@ -159,8 +160,10 @@ final class CallAudioManager extends CallsManagerListenerBase
                    newRoute = AudioState.ROUTE_SPEAKER;
                }
            }
            setSystemAudioState(mAudioState.isMuted, newRoute, calculateSupportedRoutes());
        } else {
            newRoute = AudioState.ROUTE_BLUETOOTH;
        }
        setSystemAudioState(mAudioState.isMuted, newRoute, calculateSupportedRoutes());
    }

    void toggleMute() {