Loading packages/SettingsLib/aconfig/settingslib.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +0 −4 Original line number Diff line number Diff line Loading @@ -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, Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +2 −4 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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 = Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java +0 −12 Original line number Diff line number Diff line Loading @@ -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[]{}); Loading @@ -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()); Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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()); Loading Loading
packages/SettingsLib/aconfig/settingslib.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +0 −4 Original line number Diff line number Diff line Loading @@ -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, Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +2 −4 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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 = Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java +0 −12 Original line number Diff line number Diff line Loading @@ -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[]{}); Loading @@ -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()); Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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()); Loading