Disable the optimization mode preference if the app is not settable
https://screenshot.googleplex.com/BbQyEv6YCjPVwUF (allowlist) https://screenshot.googleplex.com/3hTb8TQwGMQqcwS https://screenshot.googleplex.com/6hdTAT2yNFucD9N (system app) https://screenshot.googleplex.com/77T5JyAD5nZJpDT (normal app) Fix: 281566984 Test: make test RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.* Change-Id: If7aa4b61bc806daa570187da24b7f454cd069dec
This commit is contained in:
@@ -710,7 +710,7 @@ public class AdvancedPowerUsageDetailTest {
|
||||
|
||||
@Test
|
||||
public void initPreferenceForTriState_isValidPackageName_hasCorrectString() {
|
||||
when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(false);
|
||||
when(mBatteryOptimizeUtils.isDisabledForOptimizeModeOnly()).thenReturn(true);
|
||||
|
||||
mFragment.initPreferenceForTriState(mContext);
|
||||
|
||||
@@ -720,7 +720,7 @@ public class AdvancedPowerUsageDetailTest {
|
||||
|
||||
@Test
|
||||
public void initPreferenceForTriState_isSystemOrDefaultApp_hasCorrectString() {
|
||||
when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(true);
|
||||
when(mBatteryOptimizeUtils.isDisabledForOptimizeModeOnly()).thenReturn(false);
|
||||
when(mBatteryOptimizeUtils.isSystemOrDefaultApp()).thenReturn(true);
|
||||
|
||||
mFragment.initPreferenceForTriState(mContext);
|
||||
@@ -731,7 +731,7 @@ public class AdvancedPowerUsageDetailTest {
|
||||
|
||||
@Test
|
||||
public void initPreferenceForTriState_hasCorrectString() {
|
||||
when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(true);
|
||||
when(mBatteryOptimizeUtils.isDisabledForOptimizeModeOnly()).thenReturn(false);
|
||||
when(mBatteryOptimizeUtils.isSystemOrDefaultApp()).thenReturn(false);
|
||||
|
||||
mFragment.initPreferenceForTriState(mContext);
|
||||
|
||||
Reference in New Issue
Block a user