diff options
| author | 2023-11-28 05:44:53 +0000 | |
|---|---|---|
| committer | 2023-11-28 05:44:53 +0000 | |
| commit | d5ac539b3766bc55e86a7807c3346ce87a08a4e9 (patch) | |
| tree | d39e7fbc837cacffc7f3b895151698d79012ce0c | |
| parent | 1f50aa3cbf58d917b903d1733cccb619fdfbd8b3 (diff) | |
| parent | a8247087b1ada3e2385d8d04e3d3dddce5a8fe1a (diff) | |
Merge "AudioService: fix volume code path with a null audio device" into main
| -rw-r--r-- | services/core/java/com/android/server/audio/AudioService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index d4b72c1770f7..3f27ca024f15 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -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 |