From e3dc975acb716eede4abb0d1f4a5f969f92fc307 Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Wed, 20 Jul 2011 17:10:40 -0700 Subject: [PATCH] when disconnectHeadsetInternal, allow it when the BT is not disabled The old code allowed the disconnection only when BT is enabled. This caused a bug during BT turning off that Headset connection failed to disconnect. Change-Id: Iba15a1595b6987064f071ad90bbb126a6edfe6b5 --- core/java/android/bluetooth/BluetoothHeadset.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index 32843618dcdf..8f2b3d88c2eb 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -661,7 +661,7 @@ public final class BluetoothHeadset implements BluetoothProfile { */ public boolean disconnectHeadsetInternal(BluetoothDevice device) { if (DBG) log("disconnectHeadsetInternal"); - if (mService != null && isEnabled()) { + if (mService != null && !isDisabled()) { try { return mService.disconnectHeadsetInternal(device); } catch (RemoteException e) {Log.e(TAG, e.toString());} -- 2.11.0