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

Commit 10bbf44c authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Fix issue where incoming calls go into DND mode while ringing.

am: 00667fc0

Change-Id: Ie836868d6c26c41bcc18625dabc0199ebd258faf
parents fa16f620 00667fc0
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -282,7 +282,9 @@ public class CallAudioRouteStateMachine extends StateMachine {
            super.enter();
            setSpeakerphoneOn(false);
            setBluetoothOn(false);
            if (mAudioFocusType == ACTIVE_FOCUS) {
                setNotificationsSuppressed(true);
            }
            CallAudioState newState = new CallAudioState(mIsMuted, ROUTE_EARPIECE,
                    mAvailableRoutes);
            setSystemAudioState(newState);
@@ -333,6 +335,10 @@ public class CallAudioRouteStateMachine extends StateMachine {
                    transitionTo(mActiveSpeakerRoute);
                    return HANDLED;
                case SWITCH_FOCUS:
                    if (msg.arg1 == ACTIVE_FOCUS) {
                        setNotificationsSuppressed(true);
                    }

                    if (msg.arg1 == NO_FOCUS) {
                        reinitialize();
                    }
@@ -1284,7 +1290,10 @@ public class CallAudioRouteStateMachine extends StateMachine {
            return;
        }

        Log.i(this, "setNotificationsSuppressed: on=%s; suppressed=%s", (on ? "yes" : "no"),
                (mAreNotificationSuppressed ? "yes" : "no"));
        if (on) {
            if (!mAreNotificationSuppressed) {
                // Enabling suppression of notifications.
                int interruptionFilter = mInterruptionFilterProxy.getCurrentInterruptionFilter();
                if (interruptionFilter == NotificationManager.INTERRUPTION_FILTER_ALL) {
@@ -1298,6 +1307,7 @@ public class CallAudioRouteStateMachine extends StateMachine {
                    // it.
                    mAreNotificationSuppressed = false;
                }
            }
        } else {
            // Disabling suppression of notifications.
            if (mAreNotificationSuppressed) {