From 1206321f388333030d6301d806c826f9b3699005 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Thu, 11 Dec 2014 13:23:18 -0500 Subject: [PATCH] Fix crash in BluetoothControllerImpl Bug: 18717777 Change-Id: I396aa8b517054b1fd4c8fea7f0343f138cb261a7 --- .../statusbar/policy/BluetoothControllerImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 076cfe20c00c0..229c558fe1a94 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 @@ public class BluetoothControllerImpl implements BluetoothController { .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); + } } } }