From 051829b895e4dec2f6aa905ab4ebc4861d709e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gaffie?= Date: Mon, 23 Mar 2020 18:03:55 -0700 Subject: [PATCH] AudioService: default volume group is not restored Volume Group with associated stream type does not have their volume restored after restart / crash even if correctly stored in Settings DB. A guard prevents from restoring it. However, when using volume per attributes, Settings DB is used, so it is safe to restore volumes for all groups. This CL fixes this issue by removing this guard. Bug: 136121584 Test: set Music volume & reboot & dumpsys audio Ensure indexes matches Signed-off-by: Francois Gaffie Change-Id: I00aa8c17bffca21a128086fbbbeafffc26521a3b --- services/core/java/com/android/server/audio/AudioService.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 5652280a8179d..94675ab7d795a 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -4888,10 +4888,6 @@ public class AudioService extends IAudioService.Stub public void applyAllVolumes() { synchronized (VolumeGroupState.class) { - if (mLegacyStreamType != AudioSystem.STREAM_DEFAULT) { - // No-op to avoid regression with stream based volume management - return; - } // apply device specific volumes first int index; for (int i = 0; i < mIndexMap.size(); i++) {