Merge "Fix crash in BluetoothControllerImpl" into lmp-mr1-dev
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 076cfe2..229c558 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -289,9 +289,11 @@
.getDevicesMatchingConnectionStates(connectionType);
for (int k = 0; k < devices.size(); k++) {
DeviceInfo info = mDeviceInfo.get(devices.get(k));
- info.connectionState = CONNECTION_STATES[i];
- if (CONNECTION_STATES[i] == BluetoothProfile.STATE_CONNECTED) {
- info.connectedProfiles.put(profile, true);
+ if (info != null) {
+ info.connectionState = CONNECTION_STATES[i];
+ if (CONNECTION_STATES[i] == BluetoothProfile.STATE_CONNECTED) {
+ info.connectedProfiles.put(profile, true);
+ }
}
}
}