Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8247087 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioService: fix volume code path with a null audio device

The VolumeGroup synchronization with the VolumeStream calls
into setStreamVolume without a device.

Bug: 302751899
Test: atest android.media.audio.cts.AudioManagerTest
Test: atest com.android.audiopolicytest.AudioVolumeGroupTest
Change-Id: I27051bc8bfda8df3ff4b6998c19f40a936121680
parent a8d03d7b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4600,7 +4600,7 @@ public class AudioService extends IAudioService.Stub
    }
    private void setStreamVolume(int streamType, int index, int flags,
            @NonNull AudioDeviceAttributes ada,
            @Nullable AudioDeviceAttributes ada,
            String callingPackage, String caller, String attributionTag, int uid,
            boolean hasModifyAudioSettings,
            boolean canChangeMuteAndUpdateController) {
@@ -4618,7 +4618,9 @@ public class AudioService extends IAudioService.Stub
        int streamTypeAlias = mStreamVolumeAlias[streamType];
        VolumeStreamState streamState = mStreamStates[streamTypeAlias];
        final int device = ada.getInternalType();
        final int device = (ada == null)
                ? getDeviceForStream(streamType)
                : ada.getInternalType();
        int oldIndex;
        // skip a2dp absolute volume control request when the device