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

Commit 8aac605a authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Automerger Merge Worker
Browse files

Merge "AudioService: prevent unmute on vol raise when muted by ringer/zen"...

Merge "AudioService: prevent unmute on vol raise when muted by ringer/zen" into udc-dev am: 3bd9c629 am: 766712be

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23558219



Change-Id: I45dc1f9c79eacbcabea6cfce52f11fb9ff5fc5b7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6906686d 766712be
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3274,6 +3274,7 @@ public class AudioService extends IAudioService.Stub
            if (mUserSelectedVolumeControlStream) { // implies mVolumeControlStream != -1
                streamType = mVolumeControlStream;
            } else {
                // TODO discard activity on a muted stream?
                final int maybeActiveStreamType = getActiveStreamType(suggestedStreamType);
                final boolean activeForReal;
                if (maybeActiveStreamType == AudioSystem.STREAM_RING
@@ -3477,9 +3478,10 @@ public class AudioService extends IAudioService.Stub
            }
        } else if (isStreamMutedByRingerOrZenMode(streamTypeAlias) && streamState.mIsMuted) {
            // if the stream is currently muted streams by ringer/zen mode
            // then it cannot be unmuted (without FLAG_ALLOW_RINGER_MODES)
            // then it cannot be unmuted (without FLAG_ALLOW_RINGER_MODES) with an unmute or raise
            if (direction == AudioManager.ADJUST_TOGGLE_MUTE
                    || direction == AudioManager.ADJUST_UNMUTE) {
                    || direction == AudioManager.ADJUST_UNMUTE
                    || direction == AudioManager.ADJUST_RAISE) {
                adjustVolume = false;
            }
        }