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

Commit 104e9672 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioService: modify unmute on device plug behavior

Only unmute STREAM_MUSIC on audio device connection when the muting
doesn't come from the Zen mode's muted streams.

Bug: 128161896
Test: enter Zen mode other than NO_INTERRUPT with no media playback,
   plug headset and verify audio is muted when playing media.

Change-Id: I1ccd0ea35d8a84ec400db3d60ba509183e1abded
parent 9a1499fb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4488,6 +4488,7 @@ public class AudioService extends IAudioService.Stub
        }

        if (mNm.getZenMode() != Settings.Global.ZEN_MODE_NO_INTERRUPTIONS
                && !isStreamMutedByRingerOrZenMode(AudioSystem.STREAM_MUSIC)
                && DEVICE_MEDIA_UNMUTED_ON_PLUG_SET.contains(newDevice)
                && mStreamStates[AudioSystem.STREAM_MUSIC].mIsMuted
                && mStreamStates[AudioSystem.STREAM_MUSIC].getIndex(newDevice) != 0
@@ -6167,6 +6168,7 @@ public class AudioService extends IAudioService.Stub
        pw.println("\nRinger mode: ");
        pw.println("- mode (internal) = " + RINGER_MODE_NAMES[mRingerMode]);
        pw.println("- mode (external) = " + RINGER_MODE_NAMES[mRingerModeExternal]);
        pw.println("- zen mode:" + Settings.Global.zenModeToString(mNm.getZenMode()));
        dumpRingerModeStreams(pw, "affected", mRingerModeAffectedStreams);
        dumpRingerModeStreams(pw, "muted", mRingerAndZenModeMutedStreams);
        pw.print("- delegate = "); pw.println(mRingerModeDelegate);