[Temp bonding] Clean up old guest device logic as requirements changed

Test: manual test
Bug: 362859132
Flag: com.android.settingslib.flags.enable_temporary_bond_devices_ui
Change-Id: If4a471e2058873be5cdb0ee43371333ebdc9a38a
This commit is contained in:
Ze Li
2025-02-13 15:26:20 +08:00
parent d7b635fcc2
commit 220312eab7
14 changed files with 1 additions and 718 deletions

View File

@@ -68,9 +68,6 @@ public class ConnectedBluetoothDeviceUpdaterTest {
private static final String MAC_ADDRESS = "04:52:C7:0B:D8:3C";
private static final String TEST_EXCLUSIVE_MANAGER = "com.test.manager";
private static final String TEMP_BOND_METADATA =
"<TEMP_BOND_TYPE>le_audio_sharing</TEMP_BOND_TYPE>";
private static final int METADATA_FAST_PAIR_CUSTOMIZED_FIELDS = 25;
@Rule
public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
@@ -408,22 +405,6 @@ public class ConnectedBluetoothDeviceUpdaterTest {
verify(mBluetoothDeviceUpdater, never()).addPreference(mCachedBluetoothDevice);
}
@Test
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_TEMPORARY_BOND_DEVICES_UI)
public void update_temporaryBondDevice_removePreference() {
setUpDeviceUpdaterWithAudioMode(AudioManager.MODE_NORMAL);
when(mBluetoothDeviceUpdater
.isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true);
when(mBluetoothDevice.getMetadata(METADATA_FAST_PAIR_CUSTOMIZED_FIELDS))
.thenReturn(TEMP_BOND_METADATA.getBytes());
mBluetoothDeviceUpdater.update(mCachedBluetoothDevice);
verify(mBluetoothDeviceUpdater).removePreference(mCachedBluetoothDevice);
verify(mBluetoothDeviceUpdater, never()).addPreference(mCachedBluetoothDevice);
}
private void setUpDeviceUpdaterWithAudioMode(int audioMode) {
mAudioManager.setMode(audioMode);
mBluetoothDeviceUpdater = spy(new ConnectedBluetoothDeviceUpdater(mContext,