summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-23 17:00:39 -0700
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-23 17:00:39 -0700
commitf8d2a2452d40337f67874b432d0f68799ba20840 (patch)
tree48a7daf9611ecdbb93d99a3f036df3506b3de5e4
parentf581eeea57fda9db013c221447e7133e8d6feba4 (diff)
parent46e4fd8dc639f8201d80798063894c9a9faf35f2 (diff)
Snap for 13259233 from 46e4fd8dc639f8201d80798063894c9a9faf35f2 to 25Q2-release
Change-Id: I16038f173492098d8cb4ecc629f5e6622d017bea
-rw-r--r--android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java23
-rw-r--r--android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java4
-rw-r--r--android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java57
-rw-r--r--flags/Android.bp1
-rw-r--r--flags/BUILD.gn1
-rw-r--r--flags/active_device_manager.aconfig20
-rw-r--r--flags/gap.aconfig10
-rw-r--r--flags/mcp.aconfig13
8 files changed, 17 insertions, 112 deletions
diff --git a/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java b/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java
index 61429c8d90..3482dea3a4 100644
--- a/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java
+++ b/android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java
@@ -417,7 +417,7 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
final LeAudioService leAudioService = mFactory.getLeAudioService();
setA2dpActiveDevice(null, true);
setHfpActiveDevice(null);
- if (Flags.admVerifyActiveFallbackDevice() && leAudioService != null) {
+ if (leAudioService != null) {
setLeAudioActiveDevice(
null, !leAudioService.getActiveDevices().contains(device));
} else {
@@ -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;
}
@@ -1162,13 +1153,11 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
* recently removed device, it means it just switched profile it is using and is
* not new one.
*/
- boolean hasFallbackDevice = true;
- if (Flags.admVerifyActiveFallbackDevice()) {
- hasFallbackDevice =
- !(recentlyRemovedDevice != null
- && device.equals(recentlyRemovedDevice)
- && connectedHearingAidDevices.size() == 1);
- }
+ boolean hasFallbackDevice =
+ !(recentlyRemovedDevice != null
+ && device.equals(recentlyRemovedDevice)
+ && connectedHearingAidDevices.size() == 1);
+
if (mHearingAidConnectedDevices.contains(device)) {
Log.d(TAG, "Found a hearing aid fallback device: " + device);
setHearingAidActiveDevice(device);
diff --git a/android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java b/android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java
index b96923ca7d..aff115c59e 100644
--- a/android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java
+++ b/android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java
@@ -39,7 +39,6 @@ import com.android.bluetooth.audio_util.MediaData;
import com.android.bluetooth.audio_util.MediaPlayerList;
import com.android.bluetooth.audio_util.MediaPlayerWrapper;
import com.android.bluetooth.btservice.AdapterService;
-import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.le_audio.ContentControlIdKeeper;
import com.android.internal.annotations.VisibleForTesting;
@@ -409,8 +408,7 @@ public class MediaControlProfile implements MediaControlServiceCallbacks {
+ Request.Opcodes.toString(request.opcode()));
Request.Results status = Request.Results.COMMAND_CANNOT_BE_COMPLETED;
- if (Flags.mcpAllowPlayWithoutActivePlayer()
- && !Utils.isPtsTestMode()
+ if (!Utils.isPtsTestMode()
&& mMediaPlayerList.getActivePlayer() == null
&& request.opcode() == Request.Opcodes.PLAY) {
Log.d(TAG, "Player is not active. GMCS send media key for PLAY");
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 746e4985e9..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.
@@ -1388,7 +1333,6 @@ public class ActiveDeviceManagerTest {
* and selected as active. First LE Audio device disconnects with fallback to new one.
*/
@Test
- @EnableFlags(Flags.FLAG_ADM_VERIFY_ACTIVE_FALLBACK_DEVICE)
public void sameDeviceAsAshaAndLeAudio_noFallbackOnSwitch() {
/* Dual mode ASHA/LeAudio device from group 1 */
when(mLeAudioService.getGroupId(mHearingAidDevice)).thenReturn(1);
@@ -1426,7 +1370,6 @@ public class ActiveDeviceManagerTest {
* and selected as active. First ASHA device disconnects with fallback to new one.
*/
@Test
- @EnableFlags(Flags.FLAG_ADM_VERIFY_ACTIVE_FALLBACK_DEVICE)
public void sameDeviceAsLeAudioAndAsha_noFallbackOnSwitch() {
// Turn on the dual mode audio flag so the A2DP won't disconnect LE Audio
when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);
diff --git a/flags/Android.bp b/flags/Android.bp
index 80a57891a5..6f1e67e262 100644
--- a/flags/Android.bp
+++ b/flags/Android.bp
@@ -34,7 +34,6 @@ aconfig_declarations {
"le_scanning.aconfig",
"leaudio.aconfig",
"mapclient.aconfig",
- "mcp.aconfig",
"metric.aconfig",
"opp.aconfig",
"pairing.aconfig",
diff --git a/flags/BUILD.gn b/flags/BUILD.gn
index da5aa8621b..a53cb379fe 100644
--- a/flags/BUILD.gn
+++ b/flags/BUILD.gn
@@ -27,7 +27,6 @@ aconfig("bluetooth_flags_c_lib") {
"le_scanning.aconfig",
"leaudio.aconfig",
"mapclient.aconfig",
- "mcp.aconfig",
"metric.aconfig",
"opp.aconfig",
"pairing.aconfig",
diff --git a/flags/active_device_manager.aconfig b/flags/active_device_manager.aconfig
index b2438be452..bd55d35e16 100644
--- a/flags/active_device_manager.aconfig
+++ b/flags/active_device_manager.aconfig
@@ -2,26 +2,6 @@ package: "com.android.bluetooth.flags"
container: "com.android.bt"
flag {
- name: "adm_verify_active_fallback_device"
- namespace: "bluetooth"
- description: "Verify if device selected for fallback is different then last one"
- bug: "369799111"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-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."
diff --git a/flags/gap.aconfig b/flags/gap.aconfig
index 856f4f7bb4..1124679d42 100644
--- a/flags/gap.aconfig
+++ b/flags/gap.aconfig
@@ -270,3 +270,13 @@ flag {
description: "Add RSSI ScanFilter"
bug: "404986559"
}
+
+flag {
+ name: "fix_private_gatt_advertising_not_working"
+ namespace: "bluetooth"
+ description: "Fix that private GATT advertising is handled as a normal GATT"
+ bug: "405315235"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/flags/mcp.aconfig b/flags/mcp.aconfig
deleted file mode 100644
index 80567acae7..0000000000
--- a/flags/mcp.aconfig
+++ /dev/null
@@ -1,13 +0,0 @@
-package: "com.android.bluetooth.flags"
-container: "com.android.bt"
-
-flag {
- name: "mcp_allow_play_without_active_player"
- namespace: "bluetooth"
- description: "Handle LeAudio play same as in AVRCP in case player is not active"
- bug: "337169240"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-
-}