Merge "AS: only dispatch preferred mixer attributes change if the device is found." into udc-dev

This commit is contained in:
Jiabin Huang
2023-03-17 16:29:25 +00:00
committed by Android (Google) Code Review

View File

@@ -597,7 +597,13 @@ public class AudioDeviceInventory {
if (wdcs.mState == AudioService.CONNECTION_STATE_DISCONNECTED
&& AudioSystem.DEVICE_OUT_ALL_USB_SET.contains(
wdcs.mAttributes.getInternalType())) {
mDeviceBroker.dispatchPreferredMixerAttributesChangedCausedByDeviceRemoved(info);
if (info != null) {
mDeviceBroker.dispatchPreferredMixerAttributesChangedCausedByDeviceRemoved(
info);
} else {
Log.e(TAG, "Didn't find AudioDeviceInfo to notify preferred mixer "
+ "attributes change for type=" + wdcs.mAttributes.getType());
}
}
sendDeviceConnectionIntent(type, wdcs.mState,
wdcs.mAttributes.getAddress(), wdcs.mAttributes.getName());