diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java index a7f44ecd658..1214636c335 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java @@ -172,8 +172,14 @@ public class CachedBluetoothDeviceManager { if (!readPairedDevices()) { Log.e(TAG, "Got bonding state changed for " + device + ", but we have no record of that device."); + return; + } + cachedDevice = findDevice(device); + if (cachedDevice == null) { + Log.e(TAG, "Got bonding state changed for " + device + + "but device not added in cache"); + return; } - return; } cachedDevice.onBondingStateChanged(bondState);