Merge "Add test case - forceUpdate_deviceIsSubDevice_doNothing" am: a3d97ecd74
am: 9c2293ca92
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1925621 Change-Id: I8501963b7bd636b08107a1acd1495e74b355fea4
This commit is contained in:
@@ -250,4 +250,22 @@ public class SavedBluetoothDeviceUpdaterTest {
|
|||||||
verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice,
|
verify(mBluetoothDeviceUpdater).addPreference(mCachedBluetoothDevice,
|
||||||
BluetoothDevicePreference.SortType.TYPE_NO_SORT);
|
BluetoothDevicePreference.SortType.TYPE_NO_SORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void forceUpdate_deviceIsSubDevice_doesNothing() {
|
||||||
|
final List<BluetoothDevice> bluetoothDevices = new ArrayList<>();
|
||||||
|
bluetoothDevices.add(mBluetoothDevice);
|
||||||
|
|
||||||
|
when(mBluetoothAdapter.isEnabled()).thenReturn(true);
|
||||||
|
when(mBluetoothAdapter.getMostRecentlyConnectedDevices()).thenReturn(bluetoothDevices);
|
||||||
|
when(mBluetoothManager.getCachedDeviceManager()).thenReturn(mDeviceManager);
|
||||||
|
when(mDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedBluetoothDevice);
|
||||||
|
when(mDeviceManager.isSubDevice(mBluetoothDevice)).thenReturn(true);
|
||||||
|
|
||||||
|
mBluetoothDeviceUpdater.forceUpdate();
|
||||||
|
|
||||||
|
verify(mBluetoothDeviceUpdater, never()).removePreference(mCachedBluetoothDevice);
|
||||||
|
verify(mBluetoothDeviceUpdater, never()).addPreference(mCachedBluetoothDevice,
|
||||||
|
BluetoothDevicePreference.SortType.TYPE_NO_SORT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user