summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-07-16 21:14:50 -0400
committerJohn Spurlock <jspurlock@google.com>2014-07-16 21:19:41 -0400
commit27bdff7750f7f85fd8922385707342d37e59e406 (patch)
treeefbac137d552f20909ee8679b82a02a427d2855d /packages/SystemUI/src/com
parentbcc0eae1dc48b9a00adc8f321a86dd2805cb82a2 (diff)
downloadframeworks_base-27bdff7750f7f85fd8922385707342d37e59e406.zip
frameworks_base-27bdff7750f7f85fd8922385707342d37e59e406.tar.gz
frameworks_base-27bdff7750f7f85fd8922385707342d37e59e406.tar.bz2
QS: Deal with null uuids in BT controller.
Fix crash when the device is no longer available. Bug:16355690 Change-Id: I1cf652a408fa221649950d728bc88dd93fc93b65
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java7
1 files changed, 6 insertions, 1 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 f021623..80fec5b 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: "