summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java9
-rw-r--r--android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java55
-rw-r--r--flags/active_device_manager.aconfig10
3 files changed, 0 insertions, 74 deletions
diff --git a/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java b/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java
index 46fda180fa..3482dea3a4 100644
--- a/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java
+++ b/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java
@@ -575,9 +575,6 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
boolean hasFallbackDevice = false;
if (Objects.equals(mLeAudioActiveDevice, device)) {
hasFallbackDevice = setFallbackDeviceActiveLocked(device);
- if (!hasFallbackDevice && !Flags.admFixDisconnectOfSetMember()) {
- leAudioService.removeActiveDevice(false);
- }
}
leAudioService.deviceDisconnected(device, hasFallbackDevice);
}
@@ -1102,12 +1099,6 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
@GuardedBy("mLock")
private boolean areSameGroupMembers(BluetoothDevice firstDevice, BluetoothDevice secondDevice) {
-
- if (!Flags.admFixDisconnectOfSetMember()) {
- /* This function shall return false without the fix flag. */
- return false;
- }
-
if (firstDevice == null || secondDevice == null) {
return false;
}
diff --git a/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java b/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java
index 9a2579d59c..29ea7be622 100644
--- a/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java
+++ b/android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java
@@ -50,7 +50,6 @@ import android.content.Context;
import android.media.AudioDeviceInfo;
import android.media.AudioManager;
import android.platform.test.annotations.DisableFlags;
-import android.platform.test.annotations.EnableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import android.util.ArrayMap;
import android.util.SparseIntArray;
@@ -926,7 +925,6 @@ public class ActiveDeviceManagerTest {
/** One LE Audio is connected and disconnected later. Should then set active device to null. */
@Test
- @EnableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
public void lastLeAudioDisconnected_clearLeAudioActive() {
when(mLeAudioService.getGroupId(mLeAudioDevice)).thenReturn(1);
when(mLeAudioService.getLeadDevice(mLeAudioDevice)).thenReturn(mLeAudioDevice);
@@ -941,22 +939,6 @@ public class ActiveDeviceManagerTest {
verify(mLeAudioService).deviceDisconnected(mLeAudioDevice, false);
}
- /** One LE Audio is connected and disconnected later. Should then set active device to null. */
- @Test
- @DisableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
- public void lastLeAudioDisconnected_clearLeAudioActive_NoFixDisconnectFlag() {
- when(mLeAudioService.getGroupId(mLeAudioDevice)).thenReturn(1);
- when(mLeAudioService.getLeadDevice(mLeAudioDevice)).thenReturn(mLeAudioDevice);
-
- leAudioConnected(mLeAudioDevice);
- mTestLooper.dispatchAll();
- verify(mLeAudioService).setActiveDevice(mLeAudioDevice);
-
- leAudioDisconnected(mLeAudioDevice);
- mTestLooper.dispatchAll();
- verify(mLeAudioService).removeActiveDevice(false);
- }
-
/** Two LE Audio are connected and active device is explicitly set. */
@Test
public void leAudioActiveDeviceSelected_setActive() {
@@ -1006,7 +988,6 @@ public class ActiveDeviceManagerTest {
* fallback device should not be set to true active device to fallback device.
*/
@Test
- @EnableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
public void leAudioSecondDeviceDisconnected_noFallbackDeviceActive_ModeNormal() {
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);
@@ -1037,7 +1018,6 @@ public class ActiveDeviceManagerTest {
* fallback device should not be set to true active device to fallback device.
*/
@Test
- @EnableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
public void leAudioSecondDeviceDisconnected_noFallbackDeviceActive_ModeInCall() {
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_IN_CALL);
@@ -1068,7 +1048,6 @@ public class ActiveDeviceManagerTest {
* fallback device should not be set to true active device to fallback device.
*/
@Test
- @EnableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
public void twoLeAudioSets_OneSetDisconnected_FallbackToAnotherOne_ModeNormal() {
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);
@@ -1115,7 +1094,6 @@ public class ActiveDeviceManagerTest {
* fallback device should not be set to true active device to fallback device.
*/
@Test
- @EnableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
public void twoLeAudioSets_OneSetDisconnected_FallbackToAnotherOne_ModeInCall() {
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_IN_CALL);
@@ -1296,7 +1274,6 @@ public class ActiveDeviceManagerTest {
}
@Test
- @EnableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
public void leAudioSetConnectedGroupThenDisconnected_noFallback() {
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);
@@ -1327,38 +1304,6 @@ public class ActiveDeviceManagerTest {
order.verify(mLeAudioService).deviceDisconnected(mLeAudioDevice, false);
}
- @Test
- @DisableFlags(Flags.FLAG_ADM_FIX_DISCONNECT_OF_SET_MEMBER)
- public void leAudioSetConnectedGroupThenDisconnected_noFallback_NoFixDisconnectFlag() {
- when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);
-
- when(mLeAudioService.getGroupId(mLeAudioDevice)).thenReturn(1);
- when(mLeAudioService.getGroupId(mLeAudioDevice2)).thenReturn(1);
- when(mLeAudioService.getLeadDevice(mLeAudioDevice2)).thenReturn(mLeAudioDevice);
- when(mLeAudioService.getLeadDevice(mLeAudioDevice)).thenReturn(mLeAudioDevice);
-
- InOrder order = inOrder(mLeAudioService);
-
- leAudioConnected(mLeAudioDevice);
- mTestLooper.dispatchAll();
- order.verify(mLeAudioService).setActiveDevice(mLeAudioDevice);
-
- leAudioConnected(mLeAudioDevice2);
- mTestLooper.dispatchAll();
- order.verify(mLeAudioService, never()).setActiveDevice(any());
-
- leAudioDisconnected(mLeAudioDevice2);
- mTestLooper.dispatchAll();
- order.verify(mLeAudioService, never()).setActiveDevice(any());
- order.verify(mLeAudioService, never()).removeActiveDevice(anyBoolean());
- order.verify(mLeAudioService).deviceDisconnected(mLeAudioDevice2, false);
-
- leAudioDisconnected(mLeAudioDevice);
- mTestLooper.dispatchAll();
- order.verify(mLeAudioService).removeActiveDevice(false);
- order.verify(mLeAudioService).deviceDisconnected(mLeAudioDevice, false);
- }
-
/**
* An A2DP connected. An LE Audio connected. The LE Audio disconnected. Then the A2DP should be
* the active one.
diff --git a/flags/active_device_manager.aconfig b/flags/active_device_manager.aconfig
index ebaf40fdb9..bd55d35e16 100644
--- a/flags/active_device_manager.aconfig
+++ b/flags/active_device_manager.aconfig
@@ -2,16 +2,6 @@ package: "com.android.bluetooth.flags"
container: "com.android.bt"
flag {
- name: "adm_fix_disconnect_of_set_member"
- namespace: "bluetooth"
- description: "Fix disconnecting of the set member device. Make sure the other set member is not considered as fallback device."
- bug: "374320313"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-flag {
name: "adm_remove_handling_wired"
namespace: "bluetooth"
description: "ActiveDeviceManager doesn't need to handle adding and removing wired devices."