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

Commit 7fb83d92 authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioService: do not unmute media on headset plug in total silence mode

Fix regression introduced by fix for issue 30440012.

Bug: 66893057
Test: play a video on Chrome in DnD total silence and plug a wired
headset

Change-Id: Iee11f06edda0749a15021a4682467c14289677c3
parent 8f22de0e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4154,7 +4154,8 @@ public class AudioService extends IAudioService.Stub
                    newDevice, AudioSystem.getOutputDeviceName(newDevice)));
        }
        synchronized (mConnectedDevices) {
            if ((newDevice & DEVICE_MEDIA_UNMUTED_ON_PLUG) != 0
            if (mNm.getZenMode() != Settings.Global.ZEN_MODE_NO_INTERRUPTIONS
                    && (newDevice & DEVICE_MEDIA_UNMUTED_ON_PLUG) != 0
                    && mStreamStates[AudioSystem.STREAM_MUSIC].mIsMuted
                    && mStreamStates[AudioSystem.STREAM_MUSIC].getIndex(newDevice) != 0
                    && (newDevice & AudioSystem.getDevicesForStream(AudioSystem.STREAM_MUSIC)) != 0)