diff options
-rw-r--r-- | android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java | 4 | ||||
-rw-r--r-- | android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java | 35 | ||||
-rw-r--r-- | flags/a2dp.aconfig | 10 |
3 files changed, 14 insertions, 35 deletions
diff --git a/android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java b/android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java index a2e4d0b4d2..d02d7649d0 100644 --- a/android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +++ b/android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java @@ -132,9 +132,7 @@ final class A2dpStateMachine extends StateMachine { public void doQuit() { log("doQuit for device " + mDevice); - if (Flags.a2dpBroadcastConnectionStateWhenTurnedOff() - && mConnectionState != STATE_DISCONNECTED - && mLastConnectionState != -1) { + if (mConnectionState != STATE_DISCONNECTED && mLastConnectionState != -1) { // Broadcast CONNECTION_STATE_CHANGED when A2dpService is turned off while // the device is connected broadcastConnectionState(STATE_DISCONNECTED, mConnectionState); diff --git a/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java index f336cf6a69..5ab01d1b32 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceTest.java @@ -111,8 +111,7 @@ public class A2dpServiceTest { @Parameters(name = "{0}") public static List<FlagsParameterization> getParams() { - return FlagsParameterization.allCombinationsOf( - Flags.FLAG_A2DP_BROADCAST_CONNECTION_STATE_WHEN_TURNED_OFF); + return FlagsParameterization.allCombinationsOf(); } public A2dpServiceTest(FlagsParameterization flags) { @@ -194,11 +193,9 @@ public class A2dpServiceTest { mA2dpService.cleanup(); dispatchAtLeastOneMessage(); - if (Flags.a2dpBroadcastConnectionStateWhenTurnedOff()) { - // Verify that the intent CONNECTION_STATE_CHANGED is generated - // for the existing connections. - verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_CONNECTED); - } + // Verify that the intent CONNECTION_STATE_CHANGED is generated + // for the existing connections. + verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_CONNECTED); // Verify that setActiveDevice(null) was called during shutdown verify(mMockNativeInterface).setActiveDevice(null); @@ -641,11 +638,9 @@ public class A2dpServiceTest { assertThat(mA2dpService.getDevices()).contains(mDevice); // Device unbond - state machine is not removed mA2dpService.bondStateChangedFromTest(mDevice, BluetoothDevice.BOND_NONE); - if (Flags.a2dpBroadcastConnectionStateWhenTurnedOff()) { - // Verify that the intent CONNECTION_STATE_CHANGED is generated - // for the existing connections. - verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_CONNECTING); - } + // Verify that the intent CONNECTION_STATE_CHANGED is generated + // for the existing connections. + verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_CONNECTING); assertThat(mA2dpService.getDevices()).doesNotContain(mDevice); // A2DP stack event: CONNECTION_STATE_CONNECTED - state machine is not removed @@ -656,11 +651,9 @@ public class A2dpServiceTest { assertThat(mA2dpService.getDevices()).contains(mDevice); // Device unbond - state machine is not removed mA2dpService.bondStateChangedFromTest(mDevice, BluetoothDevice.BOND_NONE); - if (Flags.a2dpBroadcastConnectionStateWhenTurnedOff()) { - // Verify that the intent CONNECTION_STATE_CHANGED is generated - // for the existing connections. - verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_CONNECTED); - } + // Verify that the intent CONNECTION_STATE_CHANGED is generated + // for the existing connections. + verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_CONNECTED); assertThat(mA2dpService.getDevices()).doesNotContain(mDevice); // A2DP stack event: CONNECTION_STATE_DISCONNECTING - state machine is not removed @@ -672,11 +665,9 @@ public class A2dpServiceTest { assertThat(mA2dpService.getDevices()).contains(mDevice); // Device unbond - state machine is not removed mA2dpService.bondStateChangedFromTest(mDevice, BluetoothDevice.BOND_NONE); - if (Flags.a2dpBroadcastConnectionStateWhenTurnedOff()) { - // Verify that the intent CONNECTION_STATE_CHANGED is generated - // for the existing connections. - verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_DISCONNECTING); - } + // Verify that the intent CONNECTION_STATE_CHANGED is generated + // for the existing connections. + verifyConnectionStateIntent(mDevice, STATE_DISCONNECTED, STATE_DISCONNECTING); assertThat(mA2dpService.getDevices()).doesNotContain(mDevice); // A2DP stack event: CONNECTION_STATE_DISCONNECTED - state machine is not removed diff --git a/flags/a2dp.aconfig b/flags/a2dp.aconfig index ccf46f8bed..68b5abf983 100644 --- a/flags/a2dp.aconfig +++ b/flags/a2dp.aconfig @@ -39,16 +39,6 @@ flag { } flag { - name: "a2dp_broadcast_connection_state_when_turned_off" - namespace: "bluetooth" - description: "Broadcast CONNECTION_STATE_CHANGED when A2dpService is turned off while a device is connected" - bug: "360034472" - metadata { - purpose: PURPOSE_BUGFIX - } -} - -flag { name: "fix_avdt_rconfig_not_setting_l2cap" namespace: "bluetooth" description: "Set L2CAP flushable and high priority after A2DP reconfigure" |