summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-22 04:13:07 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-22 04:13:07 -0700
commit48c32ce7a0d6d0cfaff65105e4254a84bc9fb94c (patch)
tree5f70705bec850d4cab6b04f77978f88587a72661
parent0aa410dda3e5e2c78aa5926597212118ccce3e8d (diff)
parent8afea55e111df4a19808eb9eb6017a5993f14ab5 (diff)
Merge "25Q1: Remove Flag update_active_device_in_band_ringtone" into main
-rw-r--r--android/app/src/com/android/bluetooth/hfp/HeadsetService.java11
-rw-r--r--android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java41
-rw-r--r--android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceTest.java2
-rw-r--r--flags/hfp.aconfig10
4 files changed, 11 insertions, 53 deletions
diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetService.java b/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
index c5ab1f8dde..ce7c623aaf 100644
--- a/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
+++ b/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
@@ -1105,10 +1105,7 @@ public class HeadsetService extends ProfileService {
} else {
broadcastActiveDevice(null);
}
-
- if (Flags.updateActiveDeviceInBandRingtone()) {
- updateInbandRinging(null, true);
- }
+ updateInbandRinging(null, true);
}
}
@@ -1222,9 +1219,7 @@ public class HeadsetService extends ProfileService {
broadcastActiveDevice(mActiveDevice);
}
}
- if (Flags.updateActiveDeviceInBandRingtone()) {
- updateInbandRinging(device, true);
- }
+ updateInbandRinging(device, true);
}
return true;
}
@@ -1941,7 +1936,7 @@ public class HeadsetService extends ProfileService {
if (getConnectedDevices().size() > 1
|| isHeadsetClientConnected()
- || (Flags.updateActiveDeviceInBandRingtone() && mActiveDevice == null)) {
+ || mActiveDevice == null) {
mInbandRingingRuntimeDisable = true;
} else {
mInbandRingingRuntimeDisable = false;
diff --git a/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java
index 6595d55deb..4040b31d53 100644
--- a/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java
+++ b/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceAndStateMachineTest.java
@@ -491,7 +491,6 @@ public class HeadsetServiceAndStateMachineTest {
/** Test the value of isInbandRingingEnabled will be changed with the change of active device */
@Test
public void testIsInbandRingingEnabled_SwitchActiveDevice() {
- mSetFlagsRule.enableFlags(Flags.FLAG_UPDATE_ACTIVE_DEVICE_IN_BAND_RINGTONE);
BluetoothDevice device = getTestDevice(0);
connectTestDevice(device);
@@ -937,14 +936,8 @@ public class HeadsetServiceAndStateMachineTest {
BluetoothDevice deviceB = getTestDevice(1);
connectTestDevice(deviceB);
InOrder inOrder = inOrder(mNativeInterface);
- if (!Flags.updateActiveDeviceInBandRingtone()) {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(true));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- } else {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- }
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
// Set active device to device B
assertThat(mHeadsetService.setActiveDevice(deviceB)).isTrue();
mTestLooper.dispatchAll();
@@ -1004,14 +997,8 @@ public class HeadsetServiceAndStateMachineTest {
connectTestDevice(deviceA);
BluetoothDevice deviceB = getTestDevice(1);
connectTestDevice(deviceB);
- if (!Flags.updateActiveDeviceInBandRingtone()) {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(true));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- } else {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- }
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
// Set active device to device B
assertThat(mHeadsetService.setActiveDevice(deviceB)).isTrue();
mTestLooper.dispatchAll();
@@ -1071,14 +1058,8 @@ public class HeadsetServiceAndStateMachineTest {
BluetoothDevice deviceB = getTestDevice(1);
connectTestDevice(deviceB);
InOrder inOrder = inOrder(mNativeInterface);
- if (!Flags.updateActiveDeviceInBandRingtone()) {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(true));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- } else {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- }
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
// Set active device to device B
assertThat(mHeadsetService.setActiveDevice(deviceB)).isTrue();
mTestLooper.dispatchAll();
@@ -1123,14 +1104,8 @@ public class HeadsetServiceAndStateMachineTest {
BluetoothDevice deviceB = getTestDevice(1);
connectTestDevice(deviceB);
InOrder inOrder = inOrder(mNativeInterface);
- if (!Flags.updateActiveDeviceInBandRingtone()) {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(true));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- } else {
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
- inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
- }
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceA), eq(false));
+ inOrder.verify(mNativeInterface).sendBsir(eq(deviceB), eq(false));
// Set active device to device B
assertThat(mHeadsetService.setActiveDevice(deviceB)).isTrue();
mTestLooper.dispatchAll();
diff --git a/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceTest.java
index 2e03a61c22..8526408a6d 100644
--- a/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceTest.java
+++ b/android/app/tests/unit/src/com/android/bluetooth/hfp/HeadsetServiceTest.java
@@ -1247,7 +1247,6 @@ public class HeadsetServiceTest {
}
@Test
- @EnableFlags({Flags.FLAG_UPDATE_ACTIVE_DEVICE_IN_BAND_RINGTONE})
public void testIncomingCallDeviceConnect_InbandRingStatus() {
when(mDatabaseManager.getProfileConnectionPolicy(
any(BluetoothDevice.class), eq(BluetoothProfile.HEADSET)))
@@ -1269,7 +1268,6 @@ public class HeadsetServiceTest {
}
@Test
- @EnableFlags({Flags.FLAG_UPDATE_ACTIVE_DEVICE_IN_BAND_RINGTONE})
public void testIncomingCallWithDeviceAudioConnected() {
ArrayList<BluetoothDevice> connectedDevices = new ArrayList<>();
when(mDatabaseManager.getProfileConnectionPolicy(
diff --git a/flags/hfp.aconfig b/flags/hfp.aconfig
index 9e3bd50b5d..14a91bdc6e 100644
--- a/flags/hfp.aconfig
+++ b/flags/hfp.aconfig
@@ -74,16 +74,6 @@ flag {
}
flag {
- name: "update_active_device_in_band_ringtone"
- namespace: "bluetooth"
- description: "Active device update the in band ringtone, but how ringtone is played is still decided by the headset"
- bug: "349318724"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-flag {
name: "choose_wrong_hfp_codec_in_specific_config"
namespace: "bluetooth"
description: "Flag to fix codec selection in nego when the peer device only support NB and SWB."