Revert "Add PowerSaveWhitelistExceptIdle as Optimizted modes condition"

- Reverts commit e7cca4cd81
 - Add try-catch to handle unexpected operate

Reason for revert: Previous fix will cause a side effect which makes app stuck at Optimize mode after switching state from Unrestricted to Optimize, add a try catch to handle previous issue first

BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy naming, not edit by this code change

Bug: 199892006
Test: make SettingsRoboTests
Change-Id: I3b1850ab66bbf4cd605f14152a244a8ed7edd578
Merged-In: I3b1850ab66bbf4cd605f14152a244a8ed7edd578
This commit is contained in:
Wesley.CW Wang
2021-10-18 16:46:58 +08:00
committed by Wesley Wang
parent 3efe6e59f7
commit d11dec2f82
10 changed files with 10 additions and 72 deletions

View File

@@ -745,16 +745,6 @@ public class AdvancedPowerUsageDetailTest {
.isEqualTo("This app requires optimized battery usage.");
}
@Test
public void testInitPreferenceForTriState_isAllowlistedExceptIdleApp_hasCorrectString() {
when(mBatteryOptimizeUtils.isAllowlistedExceptIdleApp()).thenReturn(true);
mFragment.initPreferenceForTriState(mContext);
assertThat(mFooterPreference.getTitle().toString())
.isEqualTo("This app requires optimized battery usage.");
}
@Test
public void testInitPreferenceForTriState_isSystemOrDefaultApp_hasCorrectString() {
when(mBatteryOptimizeUtils.isValidPackageName()).thenReturn(true);