Merge "AudioService: fix NPE in AudioDeviceBroker.setCommunicationRouteForClient" into udc-qpr-dev am: 11fe11cf62 am: 91c6b5a846

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24404418

Change-Id: I920c399b91f59239fb52f7c2db8ca48416ae3e31
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Eric Laurent
2023-08-14 07:03:34 +00:00
committed by Automerger Merge Worker

View File

@@ -435,7 +435,7 @@ public class AudioDeviceBroker {
// LE Audio it stays the same and we must trigger the proper stream volume alignment, if
// LE Audio communication device is activated after the audio system has already switched to
// MODE_IN_CALL mode.
if (isBluetoothLeAudioRequested()) {
if (isBluetoothLeAudioRequested() && device != null) {
final int streamType = mAudioService.getBluetoothContextualVolumeStream();
final int leAudioVolIndex = getVssVolumeForDevice(streamType, device.getInternalType());
final int leAudioMaxVolIndex = getMaxVssVolumeForStream(streamType);