BondStateMachine: Check for null before calling getDeviceType
Bug: 128572820
Bug: 79703832
Test: Compilation
Change-Id: I711e08b076adb7b4808d04a47cb067cb95606f96
(cherry picked from commit d1dd037de2a827056f1dcdf119072646430c1e51)
diff --git a/src/com/android/bluetooth/btservice/BondStateMachine.java b/src/com/android/bluetooth/btservice/BondStateMachine.java
index e89f5e7..81e5aae 100644
--- a/src/com/android/bluetooth/btservice/BondStateMachine.java
+++ b/src/com/android/bluetooth/btservice/BondStateMachine.java
@@ -371,9 +371,9 @@
mAdapterProperties.onBondStateChanged(device, newState);
- if ((devProp.getDeviceType() == BluetoothDevice.DEVICE_TYPE_CLASSIC
+ if (devProp != null && ((devProp.getDeviceType() == BluetoothDevice.DEVICE_TYPE_CLASSIC
|| devProp.getDeviceType() == BluetoothDevice.DEVICE_TYPE_DUAL)
- && newState == BluetoothDevice.BOND_BONDED && devProp.getUuids() == null) {
+ && newState == BluetoothDevice.BOND_BONDED && devProp.getUuids() == null)) {
infoLog(device + " is bonded, wait for SDP complete to broadcast bonded intent");
if (!mPendingBondedDevices.contains(device)) {
mPendingBondedDevices.add(device);