Refine WifiWakeupPreferenceController
- Move the check for mFragment to a suitable location to avoid unnecessary checks. Bug: 235421460 Test: manual test make RunSettingsRoboTests ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest Change-Id: I638cc6f2399b1332ee7a7092854d1e2442cacccd
This commit is contained in:
@@ -94,6 +94,18 @@ public class WifiWakeupPreferenceControllerTest {
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setChecked_mFragmentIsNullLocationEnable_wifiWakeupEnable() {
|
||||
mController.setFragment(null);
|
||||
when(mLocationManager.isLocationEnabled()).thenReturn(true);
|
||||
when(mWifiManager.isScanAlwaysAvailable()).thenReturn(true);
|
||||
when(mWifiManager.isAutoWakeupEnabled()).thenReturn(false);
|
||||
|
||||
mController.setChecked(true);
|
||||
|
||||
verify(mWifiManager).setAutoWakeupEnabled(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setChecked_scanEnableLocationEnable_wifiWakeupEnable() {
|
||||
when(mWifiManager.isAutoWakeupEnabled()).thenReturn(false);
|
||||
|
Reference in New Issue
Block a user