Remove leaudio_broadcast_feature_support flag
Bug: 316005152
Test: m com.android.btservices
(cherry picked from https://android-review.googlesource.com/q/commit:8c49b368bc8b6fd0da02552e6d2503042ce68ce9)
Merged-In: I9506690e1a484444a70e4f9ac31cb358e3a6f0e3
Change-Id: I9506690e1a484444a70e4f9ac31cb358e3a6f0e3
Cherry-pick to fix b/377823669
diff --git a/android/app/src/com/android/bluetooth/bass_client/BassClientService.java b/android/app/src/com/android/bluetooth/bass_client/BassClientService.java
index dd8861a..02e8226 100644
--- a/android/app/src/com/android/bluetooth/bass_client/BassClientService.java
+++ b/android/app/src/com/android/bluetooth/bass_client/BassClientService.java
@@ -26,7 +26,6 @@
import static com.android.bluetooth.flags.Flags.leaudioBroadcastAssistantPeripheralEntrustment;
import static com.android.bluetooth.flags.Flags.leaudioBroadcastAudioHandoverPolicies;
import static com.android.bluetooth.flags.Flags.leaudioBroadcastExtractPeriodicScannerFromStateMachine;
-import static com.android.bluetooth.flags.Flags.leaudioBroadcastFeatureSupport;
import static com.android.bluetooth.flags.Flags.leaudioBroadcastMonitorSourceSyncStatus;
import android.annotation.RequiresPermission;
@@ -207,8 +206,7 @@
}
public static boolean isEnabled() {
- return leaudioBroadcastFeatureSupport()
- && BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false);
+ return BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false);
}
private static class SourceSyncRequest {
diff --git a/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java b/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java
index b3fd749..df47ec8 100644
--- a/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java
+++ b/android/app/src/com/android/bluetooth/le_audio/LeAudioService.java
@@ -24,7 +24,6 @@
import static com.android.bluetooth.flags.Flags.leaudioAllowedContextMask;
import static com.android.bluetooth.flags.Flags.leaudioBigDependsOnAudioState;
import static com.android.bluetooth.flags.Flags.leaudioBroadcastAssistantPeripheralEntrustment;
-import static com.android.bluetooth.flags.Flags.leaudioBroadcastFeatureSupport;
import static com.android.bluetooth.flags.Flags.leaudioUseAudioModeListener;
import static com.android.modules.utils.build.SdkLevel.isAtLeastU;
@@ -395,8 +394,7 @@
}
public static boolean isBroadcastEnabled() {
- return leaudioBroadcastFeatureSupport()
- && BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false);
+ return BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false);
}
private boolean registerTmap() {
diff --git a/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java b/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java
index 36396db..a9af20f 100644
--- a/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java
+++ b/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java
@@ -48,7 +48,6 @@
import com.android.bluetooth.Utils;
import com.android.bluetooth.a2dp.A2dpService;
import com.android.bluetooth.btservice.AdapterService;
-import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.hearingaid.HearingAidService;
import com.android.bluetooth.le_audio.LeAudioService;
import com.android.internal.annotations.VisibleForTesting;
@@ -2166,11 +2165,6 @@
* @return {@code true} if is broadcasting audio, {@code false} otherwise
*/
private boolean isBroadcastActive() {
- if (!Flags.leaudioBroadcastFeatureSupport()) {
- // disable this if feature flag is false
- return false;
- }
-
return mLeAudioService != null && mLeAudioService.isBroadcastActive();
}
diff --git a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java
index b2f1f3d..4efd39d 100644
--- a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java
+++ b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java
@@ -1168,7 +1168,6 @@
/** Test setting connection policy */
@Test
public void testSetConnectionPolicy() {
- mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_BROADCAST_FEATURE_SUPPORT);
doReturn(true).when(mNativeInterface).connectLeAudio(any(BluetoothDevice.class));
doReturn(true).when(mNativeInterface).disconnectLeAudio(any(BluetoothDevice.class));
doReturn(true)
diff --git a/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java
index 8b7d34b..856f991 100644
--- a/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java
+++ b/android/app/tests/unit/src/com/android/bluetooth/mcp/MediaControlGattServiceTest.java
@@ -34,7 +34,6 @@
import com.android.bluetooth.TestUtils;
import com.android.bluetooth.btservice.AdapterService;
-import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.le_audio.LeAudioService;
import org.junit.After;
@@ -1064,18 +1063,14 @@
@Test
public void testMediaControlPointeRequest_OpcodePlayCallLeAudioServiceSetActiveDevice() {
- mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_BROADCAST_FEATURE_SUPPORT);
initAllFeaturesGattService();
prepareConnectedDevice();
mMcpService.updateSupportedOpcodesChar(Request.SupportedOpcodes.PLAY, true);
verifyMediaControlPointRequest(Request.Opcodes.PLAY, null, BluetoothGatt.GATT_SUCCESS, 1);
- if (!Flags.leaudioBroadcastFeatureSupport()) {
- verify(mMockLeAudioService).setActiveDevice(any(BluetoothDevice.class));
- } else {
- final List<BluetoothLeBroadcastMetadata> metadataList = mock(List.class);
- when(mMockLeAudioService.getAllBroadcastMetadata()).thenReturn(metadataList);
- verify(mMockMcsCallbacks, times(1)).onMediaControlRequest(any(Request.class));
- }
+
+ final List<BluetoothLeBroadcastMetadata> metadataList = mock(List.class);
+ when(mMockLeAudioService.getAllBroadcastMetadata()).thenReturn(metadataList);
+ verify(mMockMcsCallbacks, times(1)).onMediaControlRequest(any(Request.class));
}
@Test
diff --git a/flags/leaudio.aconfig b/flags/leaudio.aconfig
index 2dbcdd3..f9acead 100644
--- a/flags/leaudio.aconfig
+++ b/flags/leaudio.aconfig
@@ -53,13 +53,6 @@
}
flag {
- name: "leaudio_broadcast_feature_support"
- namespace: "bluetooth"
- description: "Le audio broadcast feature roll-out control flag"
- bug: "316005152"
-}
-
-flag {
name: "metadata_api_inactive_audio_device_upon_connection"
is_exported: true
namespace: "bluetooth"
diff --git a/framework/tests/util/src/android/bluetooth/cts/TestUtils.java b/framework/tests/util/src/android/bluetooth/cts/TestUtils.java
index 8f97811..4d3a39f 100644
--- a/framework/tests/util/src/android/bluetooth/cts/TestUtils.java
+++ b/framework/tests/util/src/android/bluetooth/cts/TestUtils.java
@@ -16,7 +16,6 @@
package android.bluetooth.cts;
-import static com.android.bluetooth.flags.Flags.leaudioBroadcastFeatureSupport;
import static com.android.modules.utils.build.SdkLevel.isAtLeastV;
import static com.google.common.truth.Truth.assertThat;
@@ -99,12 +98,10 @@
}
case BluetoothProfile.LE_AUDIO_BROADCAST -> {
return isAtLeastV()
- && leaudioBroadcastFeatureSupport()
&& BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false);
}
case BluetoothProfile.LE_AUDIO_BROADCAST_ASSISTANT -> {
return isAtLeastV()
- && leaudioBroadcastFeatureSupport()
&& BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false);
}
// Hidden profile
diff --git a/system/gd/hci/le_periodic_sync_manager.h b/system/gd/hci/le_periodic_sync_manager.h
index dab7ff6..82ae83d 100644
--- a/system/gd/hci/le_periodic_sync_manager.h
+++ b/system/gd/hci/le_periodic_sync_manager.h
@@ -334,10 +334,8 @@
address_with_type, (uint16_t)event_view.GetAdvertiserPhy(),
event_view.GetPeriodicAdvertisingInterval());
- if (com::android::bluetooth::flags::leaudio_broadcast_feature_support()) {
- if (event_view.GetStatus() != ErrorCode::SUCCESS) {
- periodic_syncs_.erase(periodic_sync);
- }
+ if (event_view.GetStatus() != ErrorCode::SUCCESS) {
+ periodic_syncs_.erase(periodic_sync);
}
AdvanceRequest();
diff --git a/system/gd/hci/le_periodic_sync_manager_test.cc b/system/gd/hci/le_periodic_sync_manager_test.cc
index d8003cd..1e04913 100644
--- a/system/gd/hci/le_periodic_sync_manager_test.cc
+++ b/system/gd/hci/le_periodic_sync_manager_test.cc
@@ -527,9 +527,7 @@
sync_handler();
}
-TEST_F_WITH_FLAGS(PeriodicSyncManagerTest, handle_advertising_sync_established_after_error_test,
- REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(TEST_BT,
- leaudio_broadcast_feature_support))) {
+TEST_F(PeriodicSyncManagerTest, handle_advertising_sync_established_after_error_test) {
uint16_t sync_handle = 0x12;
uint8_t advertiser_sid = 0x02;
// start scan