summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaurav Asati <gasati@codeaurora.org>2014-06-12 16:31:55 +0530
committerSteve Kondik <shade@chemlab.org>2014-10-11 16:31:43 -0700
commit93e2c8ce4b6a14bfb23d301eafafaaafe033484c (patch)
treefb3cf8660f9114941fdcfe3aceafabae1e045aa5
parent9f2fb32dc30d63dfa91355b625ae4f1190194192 (diff)
downloadandroid_packages_apps_Bluetooth-93e2c8ce4b6a14bfb23d301eafafaaafe033484c.tar.gz
android_packages_apps_Bluetooth-93e2c8ce4b6a14bfb23d301eafafaaafe033484c.tar.bz2
android_packages_apps_Bluetooth-93e2c8ce4b6a14bfb23d301eafafaaafe033484c.zip
Bluetooth: Remove Connect time-out in stable state.
Remove connect time-out when moved to Connected/Disconnected instead of Pending state. Initiate disconnect on timer expiry. Change-Id: I687d6916e037c30e6c0619bfe6404ddd4ddfa46a CRs-Fixed: 678043
-rw-r--r--src/com/android/bluetooth/a2dp/A2dpStateMachine.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
index 7648acd90..1274590f3 100644
--- a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
+++ b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
@@ -188,6 +188,8 @@ final class A2dpStateMachine extends StateMachine {
@Override
public void enter() {
log("Enter Disconnected: " + getCurrentMessage().what);
+ // Remove Timeout msg when moved to stable state
+ removeMessages(CONNECT_TIMEOUT);
}
@Override
@@ -320,6 +322,7 @@ final class A2dpStateMachine extends StateMachine {
deferMessage(message);
break;
case CONNECT_TIMEOUT:
+ disconnectA2dpNative(getByteAddress(mTargetDevice));
onConnectionStateChanged(CONNECTION_STATE_DISCONNECTED,
getByteAddress(mTargetDevice));
break;
@@ -342,7 +345,6 @@ final class A2dpStateMachine extends StateMachine {
log("Stack Event: " + event.type);
switch (event.type) {
case EVENT_TYPE_CONNECTION_STATE_CHANGED:
- removeMessages(CONNECT_TIMEOUT);
processConnectionEvent(event.valueInt, event.device);
break;
default:
@@ -509,6 +511,7 @@ final class A2dpStateMachine extends StateMachine {
@Override
public void enter() {
log("Enter Connected: " + getCurrentMessage().what);
+ removeMessages(CONNECT_TIMEOUT);
// Upon connected, the audio starts out as stopped
broadcastAudioState(mCurrentDevice, BluetoothA2dp.STATE_NOT_PLAYING,
BluetoothA2dp.STATE_PLAYING);