AudioService: fix stream aliasing update
When updating the stream aliases table, mStreamVolumeAlias should point to a copy of the default alias table it's starting from, not its reference. This fixes an issue where changing the aliasing between ring and notification would work when unaliasing, but not when aliasing, as the contents of the alias table had been overwritten already. Bug: 265076070 Test: atest android.media.audio.cts.AudioManagerTest#testStreamTypeAliasChange Change-Id: I74bc7fdf054ef295876c8a5503111c14d084e8d2
This commit is contained in:
@@ -2206,19 +2206,19 @@ public class AudioService extends IAudioService.Stub
|
||||
AudioSystem.STREAM_ASSISTANT : AudioSystem.STREAM_MUSIC;
|
||||
|
||||
if (mIsSingleVolume) {
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_TELEVISION;
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_TELEVISION.clone();
|
||||
dtmfStreamAlias = AudioSystem.STREAM_MUSIC;
|
||||
} else if (mUseVolumeGroupAliases) {
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_NONE;
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_NONE.clone();
|
||||
dtmfStreamAlias = AudioSystem.STREAM_DTMF;
|
||||
} else {
|
||||
switch (mPlatformType) {
|
||||
case AudioSystem.PLATFORM_VOICE:
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_VOICE;
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_VOICE.clone();
|
||||
dtmfStreamAlias = AudioSystem.STREAM_RING;
|
||||
break;
|
||||
default:
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_DEFAULT;
|
||||
mStreamVolumeAlias = STREAM_VOLUME_ALIAS_DEFAULT.clone();
|
||||
dtmfStreamAlias = AudioSystem.STREAM_MUSIC;
|
||||
}
|
||||
if (!mNotifAliasRing) {
|
||||
|
||||
Reference in New Issue
Block a user