summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nitin Jadhav <jadhavnitin@google.com> 2025-03-18 09:33:55 +0000
committer Nitin Jadhav (xWF) <jadhavnitin@google.com> 2025-03-22 02:37:20 -0700
commit8afea55e111df4a19808eb9eb6017a5993f14ab5 (patch)
tree68f70903ed10358f1b044d38fddcfce21c4a0384
parent2c08b685a024cfdc1381c5b4a194a0bf5d0b3449 (diff)
25Q1: Remove Flag update_active_device_in_band_ringtone
Bug: 349318724 Fix: 349318724 Test: m com.google.android.bt Test: atest -v HeadsetServiceAndStateMachineTest -c Test: atest -v HeadsetServiceTest -c Change-Id: I8f1f4f7195a8da595c9d1df3ed7fce7daacfcbd2
-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 251f347ea2..0a6719b05a 100644
--- a/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
+++ b/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
@@ -1409,10 +1409,7 @@ public class HeadsetService extends ProfileService {
} else {
broadcastActiveDevice(null);
}
-
- if (Flags.updateActiveDeviceInBandRingtone()) {
- updateInbandRinging(null, true);
- }
+ updateInbandRinging(null, true);
}
}
@@ -1526,9 +1523,7 @@ public class HeadsetService extends ProfileService {
broadcastActiveDevice(mActiveDevice);
}
}
- if (Flags.updateActiveDeviceInBandRingtone()) {
- updateInbandRinging(device, true);
- }
+ updateInbandRinging(device, true);
}
return true;
}
@@ -2247,7 +2242,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 835f03aaa2..fc939352ad 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
@@ -490,7 +490,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);
@@ -936,14 +935,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();
@@ -1003,14 +996,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();
@@ -1070,14 +1057,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();
@@ -1122,14 +1103,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 b16578c823..f5b0f31019 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 c1611242aa..7cb865aeff 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."