audio:fix STREAM_SYSTEM_ENFORCED index when camera sound forced

set index to indexMax

Signed-off-by: liuxiaoyu7 <liuxiaoyu7@xiaomi.com>
Change-Id: I542a4e7c8b2465a496055e0f65aacd470388384c
This commit is contained in:
liuxiaoyu7
2021-05-11 13:02:40 +08:00
parent 964fccfefd
commit 82c6cbd595

View File

@@ -5860,6 +5860,10 @@ public class AudioService extends IAudioService.Stub
if (index == -1) {
continue;
}
if (mPublicStreamType == AudioSystem.STREAM_SYSTEM_ENFORCED
&& mCameraSoundForced) {
index = mIndexMax;
}
if (DEBUG_VOL) {
Log.v(TAG, "readSettings: found stored index " + getValidIndex(index)
+ " for group " + mAudioVolumeGroup.name() + ", device: " + name);