From 27bdff7750f7f85fd8922385707342d37e59e406 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Wed, 16 Jul 2014 21:14:50 -0400 Subject: [PATCH] QS: Deal with null uuids in BT controller. Fix crash when the device is no longer available. Bug:16355690 Change-Id: I1cf652a408fa221649950d728bc88dd93fc93b65 --- .../systemui/statusbar/policy/BluetoothControllerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 f02162364de66..80fec5b0c232b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java @@ -180,8 +180,13 @@ public class BluetoothControllerImpl implements BluetoothController { final BluetoothDevice device = (BluetoothDevice) pd.tag; final String action = connect ? "connect" : "disconnect"; if (DEBUG) Log.d(TAG, action + " " + deviceToString(device)); + final ParcelUuid[] uuids = device.getUuids(); + if (uuids == null) { + Log.w(TAG, "No uuids returned, aborting " + action + " for " + deviceToString(device)); + return; + } final SparseBooleanArray profiles = new SparseBooleanArray(); - for (ParcelUuid uuid : device.getUuids()) { + for (ParcelUuid uuid : uuids) { final int profile = uuidToProfile(uuid); if (profile == 0) { Log.w(TAG, "Device " + deviceToString(device) + " has an unsupported uuid: "