Merge "audio:Suppress device volume to safe volume" am: d2717d9e9d

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie2cccfe1c9157b15fa1fa383df22723f3319777e
This commit is contained in:
Eric Laurent
2021-02-24 17:28:00 +00:00
committed by Automerger Merge Worker

View File

@@ -6554,7 +6554,10 @@ public class AudioService extends IAudioService.Stub
private void onSetVolumeIndexOnDevice(@NonNull DeviceVolumeUpdate update) {
final VolumeStreamState streamState = mStreamStates[update.mStreamType];
if (update.hasVolumeIndex()) {
final int index = update.getVolumeIndex();
int index = update.getVolumeIndex();
if (!checkSafeMediaVolume(update.mStreamType, index, update.mDevice)) {
index = safeMediaVolumeIndex(update.mDevice);
}
streamState.setIndex(index, update.mDevice, update.mCaller,
// trusted as index is always validated before message is posted
true /*hasModifyAudioSettings*/);