Resolve NPE with AudioManager#getCommunicationDevice
AudioManager#getCommunicationDevice was returning null which was causing
Telecom to crash. Resolve the NPE on the reference.
Bug: 371895991
Flag: EXEMPT NPE fix
Test: Manual
Change-Id: I15cfa547f30e0657ee7234afd0241f1a25698072
diff --git a/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java b/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
index 0f27dad..176e479 100644
--- a/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
+++ b/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
@@ -759,7 +759,7 @@
Log.w(this, "setCommunicationDeviceForAddress: Device %s not found.", address);
return false;
}
- if (mAudioManager.getCommunicationDevice().equals(deviceInfo)) {
+ if (deviceInfo.equals(mAudioManager.getCommunicationDevice())) {
Log.i(this, "setCommunicationDeviceForAddress: Device %s already active.", address);
return true;
}