Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c03efad3 authored by Yuyang Huang's avatar Yuyang Huang
Browse files

Remove auto_connect_on_hfp_when_no_a2dp_device flag

This flag was added in Android U to enable auto-connecting to HFP devices when there is no A2DP device to connect to. This flag has been enabled by default since 24Q2, and there have been no reports of any issues with it. Therefore, it is safe to remove this flag.

Change-Id: Ic73e00116cc1d766d997eb76ba89850bbc2f6569
Test: atest PhonePolicyTest
Bug: 347316578
Flag: exempt, remove nextfood flag
parent fcf1fa4b
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -887,11 +887,6 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback {
            return;
        }

        if (!Flags.autoConnectOnHfpWhenNoA2dpDevice()) {
            debugLog("HFP auto connect is not enabled");
            return;
        }

        if (Flags.autoConnectOnMultipleHfpWhenNoA2dpDevice()) {
            final List<BluetoothDevice> mostRecentlyConnectedHfpDevices =
                    mDatabaseManager.getMostRecentlyActiveHfpDevices();
+0 −3
Original line number Diff line number Diff line
@@ -1071,7 +1071,6 @@ public class PhonePolicyTest {
     */
    @Test
    public void testAutoConnectHfpOnly() {
        mSetFlagsRule.enableFlags(Flags.FLAG_AUTO_CONNECT_ON_HFP_WHEN_NO_A2DP_DEVICE);
        mSetFlagsRule.disableFlags(Flags.FLAG_AUTO_CONNECT_ON_MULTIPLE_HFP_WHEN_NO_A2DP_DEVICE);

        // Return desired values from the mocked object(s)
@@ -1109,7 +1108,6 @@ public class PhonePolicyTest {

    @Test
    public void autoConnect_whenMultiHfp_startConnection() {
        mSetFlagsRule.enableFlags(Flags.FLAG_AUTO_CONNECT_ON_HFP_WHEN_NO_A2DP_DEVICE);
        mSetFlagsRule.enableFlags(Flags.FLAG_AUTO_CONNECT_ON_MULTIPLE_HFP_WHEN_NO_A2DP_DEVICE);

        // Return desired values from the mocked object(s)
@@ -1154,7 +1152,6 @@ public class PhonePolicyTest {
    @Test
    public void autoConnect_whenMultiHfpAndDeconnection_startConnection() {
        mSetFlagsRule.enableFlags(Flags.FLAG_AUTO_CONNECT_ON_MULTIPLE_HFP_WHEN_NO_A2DP_DEVICE);
        mSetFlagsRule.enableFlags(Flags.FLAG_AUTO_CONNECT_ON_HFP_WHEN_NO_A2DP_DEVICE);

        // Return desired values from the mocked object(s)
        doReturn(BluetoothAdapter.STATE_ON).when(mAdapterService).getState();
+0 −7
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.btservices"

flag {
    name: "auto_connect_on_hfp_when_no_a2dp_device"
    namespace: "bluetooth"
    description: "Auto connect to hfp device is there is no a2dp device to connect to"
    bug: "305799237"
}

flag {
    name: "auto_connect_on_multiple_hfp_when_no_a2dp_device"
    namespace: "bluetooth"