diff options
author | Hall Liu <hallliu@google.com> | 2019-02-22 15:45:15 -0800 |
---|---|---|
committer | Hall Liu <hallliu@google.com> | 2019-02-22 15:45:15 -0800 |
commit | 0003bdb67ef5e85a8435bf78629d5c4ec605a9f7 (patch) | |
tree | 20ad911114edd5d372af80bd269a6614a16e3df9 /tests/src/com/android/server/telecom | |
parent | 168fe2f078c8cc6af6ba5fcc204ab8031e692c5b (diff) | |
download | android_packages_services_Telecomm-0003bdb67ef5e85a8435bf78629d5c4ec605a9f7.tar.gz android_packages_services_Telecomm-0003bdb67ef5e85a8435bf78629d5c4ec605a9f7.tar.bz2 android_packages_services_Telecomm-0003bdb67ef5e85a8435bf78629d5c4ec605a9f7.zip |
Fix a race condition in BT device handling
When a headset or hearing aid disconnects in favor of the other, we have
a few milliseconds between when BT sends a "device disconnected" for the
first device and when it tells us that the second device is connected.
This causes us to go into a non-BT audio route for a while, but this
sends a "please disconnect audio" message to BT, which disrupts the
setup on the second device.
This change removes the "please disconnect audio" after a BT-initiated
disconnect, since it's redundant anyway.
Test: manual, unit
Bug: 122920967
Change-Id: I5f60b4b68c66c68a73d1fc0dd4e3122b35706d5e
Diffstat (limited to 'tests/src/com/android/server/telecom')
-rw-r--r-- | tests/src/com/android/server/telecom/tests/CallAudioRouteTransitionTests.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/src/com/android/server/telecom/tests/CallAudioRouteTransitionTests.java b/tests/src/com/android/server/telecom/tests/CallAudioRouteTransitionTests.java index 26d2419a..e63fe9bc 100644 --- a/tests/src/com/android/server/telecom/tests/CallAudioRouteTransitionTests.java +++ b/tests/src/com/android/server/telecom/tests/CallAudioRouteTransitionTests.java @@ -507,7 +507,7 @@ public class CallAudioRouteTransitionTests extends TelecomTestCase { CallAudioState.ROUTE_BLUETOOTH, // initialRoute CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_BLUETOOTH, // availableRoutes OPTIONAL, // speakerInteraction - OFF, // bluetoothInteraction + NONE, // bluetoothInteraction SPECIAL_DISCONNECT_BT_ACTION, // action CallAudioState.ROUTE_EARPIECE, // expectedRoute CallAudioState.ROUTE_EARPIECE, // expectedAvailableRoutes @@ -519,7 +519,7 @@ public class CallAudioRouteTransitionTests extends TelecomTestCase { CallAudioState.ROUTE_BLUETOOTH, // initialRoute CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_BLUETOOTH, // availableRou OPTIONAL, // speakerInteraction - OFF, // bluetoothInteraction + NONE, // bluetoothInteraction SPECIAL_DISCONNECT_BT_ACTION, // action CallAudioState.ROUTE_WIRED_HEADSET, // expectedRoute CallAudioState.ROUTE_WIRED_HEADSET, // expectedAvailableRoutes @@ -711,7 +711,7 @@ public class CallAudioRouteTransitionTests extends TelecomTestCase { CallAudioState.ROUTE_BLUETOOTH, // initialRoute CallAudioState.ROUTE_BLUETOOTH, // availableRoutes ON, // speakerInteraction - OFF, // bluetoothInteraction + NONE, // bluetoothInteraction SPECIAL_DISCONNECT_BT_ACTION, // action CallAudioState.ROUTE_SPEAKER, // expectedRoute CallAudioState.ROUTE_SPEAKER, // expectedAvailableRoutes @@ -723,7 +723,7 @@ public class CallAudioRouteTransitionTests extends TelecomTestCase { CallAudioState.ROUTE_BLUETOOTH, // initialRoute CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_BLUETOOTH, // availableRoutes OPTIONAL, // speakerInteraction - OFF, // bluetoothInteraction + NONE, // bluetoothInteraction CallAudioRouteStateMachine.BT_ACTIVE_DEVICE_GONE, // action CallAudioState.ROUTE_EARPIECE, // expectedRoute CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_BLUETOOTH, // expectedAvailabl |