Fix connected devices settings jank issue
Completed the UI in displayPreference() to fix jank issue. Bug: 188752628 Test: make RunSettingsRoboTests Change-Id: Ib97b76e1b8622424ad481597f63d3540fb0bfc5b
This commit is contained in:
@@ -87,7 +87,7 @@ public class AddDevicePreferenceControllerTest {
|
||||
@Test
|
||||
public void addDevice_bt_resume_on_then_off() {
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(true);
|
||||
mAddDevicePreferenceController.updateState();
|
||||
mAddDevicePreferenceController.updateState(mAddDevicePreference);
|
||||
assertTrue(TextUtils.isEmpty(mAddDevicePreference.getSummary()));
|
||||
|
||||
Intent intent = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED);
|
||||
@@ -103,7 +103,7 @@ public class AddDevicePreferenceControllerTest {
|
||||
@Test
|
||||
public void addDevice_bt_resume_off_then_on() {
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(false);
|
||||
mAddDevicePreferenceController.updateState();
|
||||
mAddDevicePreferenceController.updateState(mAddDevicePreference);
|
||||
assertThat(mAddDevicePreference.getSummary()).isEqualTo(
|
||||
mContext.getString(R.string.connected_device_add_device_summary));
|
||||
|
||||
@@ -131,9 +131,8 @@ public class AddDevicePreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_bluetoothIsDisabled_unSupported() {
|
||||
mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true);
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(false);
|
||||
public void getAvailabilityStatus_noBluetoothFeature_unSupported() {
|
||||
mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, false);
|
||||
|
||||
assertThat(mAddDevicePreferenceController.getAvailabilityStatus())
|
||||
.isEqualTo(UNSUPPORTED_ON_DEVICE);
|
||||
|
Reference in New Issue
Block a user