From 8afea55e111df4a19808eb9eb6017a5993f14ab5 Mon Sep 17 00:00:00 2001 From: Nitin Jadhav Date: Tue, 18 Mar 2025 09:33:55 +0000 Subject: 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 --- .../com/android/bluetooth/hfp/HeadsetService.java | 11 ++---- .../hfp/HeadsetServiceAndStateMachineTest.java | 41 +++++----------------- .../android/bluetooth/hfp/HeadsetServiceTest.java | 2 -- flags/hfp.aconfig | 10 ------ 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 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 @@ -73,16 +73,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" -- cgit v1.2.3-59-g8ed1b