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

Commit 6e6f2f07 authored by Ze Li's avatar Ze Li
Browse files

[Flag removal] Remove flag enable_temporary_bond_devices_ui

Test: manual test
Bug: 414210381
Flag: EXEMPT flag removal
Change-Id: Id7f8cd756d70362e28a2b66dd88cb2e36cf2a83e
parent 9eef798c
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -193,16 +193,6 @@ flag {
    }
}

flag {
    name: "enable_temporary_bond_devices_ui"
    namespace: "cross_device_experiences"
    description: "UI changes for temporary bond devices in audio sharing."
    bug: "362859132"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "adopt_primary_group_management_api"
    namespace: "cross_device_experiences"
+0 −4
Original line number Diff line number Diff line
@@ -1228,10 +1228,6 @@ public class BluetoothUtils {
     */
    public static void setTemporaryBondMetadata(@Nullable BluetoothDevice device) {
        if (device == null) return;
        if (!Flags.enableTemporaryBondDevicesUi()) {
            Log.d(TAG, "Skip setTemporaryBondMetadata, flag is disabled");
            return;
        }
        String fastPairCustomizedMeta = getStringMetaData(device,
                METADATA_FAST_PAIR_CUSTOMIZED_FIELDS);
        String fullContentWithTag = generateExpressionWithTag(TEMP_BOND_TYPE,
+2 −4
Original line number Diff line number Diff line
@@ -1483,8 +1483,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
        if (mBluetoothManager == null) {
            mBluetoothManager = LocalBluetoothManager.getInstance(mContext, null);
        }
        boolean isTempBond = Flags.enableTemporaryBondDevicesUi()
                && BluetoothUtils.isTemporaryBondDevice(getDevice());
        boolean isTempBond = BluetoothUtils.isTemporaryBondDevice(getDevice());
        if (BluetoothUtils.hasConnectedBroadcastSource(this, mBluetoothManager)) {
            // Gets summary for the buds which are in the audio sharing.
            int groupId = BluetoothUtils.getGroupId(this);
@@ -1687,8 +1686,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
                rightBattery = getRightBatteryLevel();
            }

            boolean isTempBond = Flags.enableTemporaryBondDevicesUi()
                    && BluetoothUtils.isTemporaryBondDevice(getDevice());
            boolean isTempBond = BluetoothUtils.isTemporaryBondDevice(getDevice());
            // Set default string with battery level in device connected situation.
            if (isTwsBatteryAvailable(leftBattery, rightBattery)) {
                stringRes =
+0 −12
Original line number Diff line number Diff line
@@ -1398,17 +1398,6 @@ public class BluetoothUtilsTest {
    }

    @Test
    @DisableFlags(Flags.FLAG_ENABLE_TEMPORARY_BOND_DEVICES_UI)
    public void setTemporaryBondDevice_flagOff_doNothing() {
        when(mBluetoothDevice.getMetadata(METADATA_FAST_PAIR_CUSTOMIZED_FIELDS))
                .thenReturn(new byte[]{});
        BluetoothUtils.setTemporaryBondMetadata(mBluetoothDevice);
        verify(mBluetoothDevice, never()).setMetadata(eq(METADATA_FAST_PAIR_CUSTOMIZED_FIELDS),
                any());
    }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TEMPORARY_BOND_DEVICES_UI)
    public void setTemporaryBondDevice_flagOn_setCorrectValue() {
        when(mBluetoothDevice.getMetadata(METADATA_FAST_PAIR_CUSTOMIZED_FIELDS))
                .thenReturn(new byte[]{});
@@ -1418,7 +1407,6 @@ public class BluetoothUtilsTest {
    }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TEMPORARY_BOND_DEVICES_UI)
    public void setTemporaryBondDevice_flagOff_replaceAndSetCorrectValue() {
        when(mBluetoothDevice.getMetadata(METADATA_FAST_PAIR_CUSTOMIZED_FIELDS))
                .thenReturn(FAKE_TEMP_BOND_METADATA.getBytes());
+0 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
package com.android.settingslib.bluetooth;

import static com.android.settingslib.flags.Flags.FLAG_ENABLE_LE_AUDIO_SHARING;
import static com.android.settingslib.flags.Flags.FLAG_ENABLE_TEMPORARY_BOND_DEVICES_UI;
import static com.android.settingslib.flags.Flags.FLAG_REFACTOR_BATTERY_LEVEL_DISPLAY;

import static com.google.common.truth.Truth.assertThat;
@@ -150,7 +149,6 @@ public class CachedBluetoothDeviceTest {
        MockitoAnnotations.initMocks(this);
        mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_TV_MEDIA_OUTPUT_DIALOG);
        mSetFlagsRule.enableFlags(FLAG_ENABLE_LE_AUDIO_SHARING);
        mSetFlagsRule.enableFlags(FLAG_ENABLE_TEMPORARY_BOND_DEVICES_UI);
        mContext = RuntimeEnvironment.application;
        mAudioManager = mContext.getSystemService(AudioManager.class);
        mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter());