Merge "AudioService: prevent unmute on vol raise when muted by ringer/zen" into udc-dev am: 3bd9c6292d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23558219 Change-Id: I4f210293b08a623068f31f1fd7d467b36e0d403a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3277,6 +3277,7 @@ public class AudioService extends IAudioService.Stub
|
|||||||
if (mUserSelectedVolumeControlStream) { // implies mVolumeControlStream != -1
|
if (mUserSelectedVolumeControlStream) { // implies mVolumeControlStream != -1
|
||||||
streamType = mVolumeControlStream;
|
streamType = mVolumeControlStream;
|
||||||
} else {
|
} else {
|
||||||
|
// TODO discard activity on a muted stream?
|
||||||
final int maybeActiveStreamType = getActiveStreamType(suggestedStreamType);
|
final int maybeActiveStreamType = getActiveStreamType(suggestedStreamType);
|
||||||
final boolean activeForReal;
|
final boolean activeForReal;
|
||||||
if (maybeActiveStreamType == AudioSystem.STREAM_RING
|
if (maybeActiveStreamType == AudioSystem.STREAM_RING
|
||||||
@@ -3480,9 +3481,10 @@ public class AudioService extends IAudioService.Stub
|
|||||||
}
|
}
|
||||||
} else if (isStreamMutedByRingerOrZenMode(streamTypeAlias) && streamState.mIsMuted) {
|
} else if (isStreamMutedByRingerOrZenMode(streamTypeAlias) && streamState.mIsMuted) {
|
||||||
// if the stream is currently muted streams by ringer/zen mode
|
// 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
|
if (direction == AudioManager.ADJUST_TOGGLE_MUTE
|
||||||
|| direction == AudioManager.ADJUST_UNMUTE) {
|
|| direction == AudioManager.ADJUST_UNMUTE
|
||||||
|
|| direction == AudioManager.ADJUST_RAISE) {
|
||||||
adjustVolume = false;
|
adjustVolume = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user