diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2010-11-01 14:57:36 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2010-11-01 15:04:06 -0700 |
commit | 7a0f816916abb200d9337a5afde5d6d2a637a20a (patch) | |
tree | d2e384e7be298c20dfa8b7eec11f7ed35995ae8b /core | |
parent | 06487a58be22b100daf3f950b9a1d25c3ea42aa2 (diff) | |
download | frameworks_base-7a0f816916abb200d9337a5afde5d6d2a637a20a.zip frameworks_base-7a0f816916abb200d9337a5afde5d6d2a637a20a.tar.gz frameworks_base-7a0f816916abb200d9337a5afde5d6d2a637a20a.tar.bz2 |
Disconnect PAN and Input devices on BT disable.
Also, add a missing break.
Change-Id: I228f80a4223de20e60d2f3828e3f63bdc14f5afc
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/bluetooth/BluetoothDeviceProfileState.java | 1 | ||||
-rw-r--r-- | core/java/android/server/BluetoothService.java | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java index 0c8e4d9..138e7f2 100644 --- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java +++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java @@ -773,6 +773,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine case CONNECT_HFP_INCOMING: transitionTo(mIncomingHandsfree); + break; case CONNECT_A2DP_INCOMING: transitionTo(mIncomingA2dp); diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 7289012..ec8f031 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -385,11 +385,23 @@ public class BluetoothService extends IBluetooth.Stub { // Allow 3 seconds for profiles to gracefully disconnect // TODO: Introduce a callback mechanism so that each profile can notify // BluetoothService when it is done shutting down + disconnectDevices(); + mHandler.sendMessageDelayed( mHandler.obtainMessage(MESSAGE_FINISH_DISABLE, saveSetting ? 1 : 0, 0), 3000); return true; } + private synchronized void disconnectDevices() { + // Disconnect devices handled by BluetoothService. + for (BluetoothDevice device: getConnectedInputDevices()) { + disconnectInputDevice(device); + } + + for (BluetoothDevice device: getConnectedPanDevices()) { + disconnectPanDevice(device); + } + } private synchronized void finishDisable(boolean saveSetting) { if (mBluetoothState != BluetoothAdapter.STATE_TURNING_OFF) { |