From 268d1f1e4b7266f0d7c04895a73c9c35472eacd5 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Wed, 13 Oct 2010 10:53:05 -0700 Subject: [PATCH] DO NOT MERGE Add null check before disconnecting a device. Bug: 3076404 Change-Id: I8ef140395503816296124a38e42ab9cc7e6f7159 --- .../settings/bluetooth/LocalBluetoothProfileManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java index 01714fe6029..5fcddf0ab47 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java @@ -379,7 +379,8 @@ public abstract class LocalBluetoothProfileManager { @Override public boolean disconnect(BluetoothDevice device) { - if (mService.getCurrentHeadset().equals(device)) { + BluetoothDevice currDevice = mService.getCurrentHeadset(); + if (currDevice != null && currDevice.equals(device)) { // Downgrade prority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothHeadset.PRIORITY_ON) { mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);