summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkateshwarlu Domakonda <vdomak@codeaurora.org>2015-10-28 14:38:08 +0530
committerVenkateshwarlu Domakonda <vdomak@codeaurora.org>2015-10-28 14:50:40 +0530
commit54ef1c6f6da0ce67743ea4274232abcf73c799df (patch)
tree58dabb7abfd1a2613668786bc9268b92247b32c3
parent76d16d9e19d762eb9ad9e66a03a4d127a7bc55d7 (diff)
downloadandroid_packages_apps_Bluetooth-54ef1c6f6da0ce67743ea4274232abcf73c799df.tar.gz
android_packages_apps_Bluetooth-54ef1c6f6da0ce67743ea4274232abcf73c799df.tar.bz2
android_packages_apps_Bluetooth-54ef1c6f6da0ce67743ea4274232abcf73c799df.zip
Bluetooth: Send the state change before cleanup
Cleanup is happening from application before receiving state change from btif. Send broadcast for change state before cleanup the handle. Change-Id: Ic2ca04d2b4b07c3efbb1e6e69fe0790e0ba94b91 CRs-Fixed: 931480
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpStateMachine.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
index 1c6610ff4..a614fbd50 100644
--- a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
+++ b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
@@ -214,6 +214,13 @@ final class A2dpStateMachine extends StateMachine {
}
public void cleanup() {
+ int deviceSize = mConnectedDevicesList.size();
+ log("cleanup: mConnectedDevicesList size is " + deviceSize);
+ for (int i = 0; i < deviceSize; i++) {
+ mCurrentDevice = mConnectedDevicesList.get(i);
+ broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED,
+ BluetoothProfile.STATE_CONNECTED);
+ }
cleanupNative();
}