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
This commit is contained in:
committed by
Wesley Wang
parent
ee4e89e54f
commit
2146a873c2
@@ -363,17 +363,17 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
||||
final String footerString;
|
||||
|
||||
if (!mBatteryOptimizeUtils.isValidPackageName()) {
|
||||
//Present optimized only string when the package name is invalid.
|
||||
// Present optimized only string when the package name is invalid.
|
||||
stateString = context.getString(R.string.manager_battery_usage_optimized_only);
|
||||
footerString = context.getString(
|
||||
R.string.manager_battery_usage_footer_limited, stateString);
|
||||
} else if (mBatteryOptimizeUtils.isSystemOrDefaultApp()) {
|
||||
//Present unrestricted only string when the package is system or default active app.
|
||||
// Present unrestricted only string when the package is system or default active app.
|
||||
stateString = context.getString(R.string.manager_battery_usage_unrestricted_only);
|
||||
footerString = context.getString(
|
||||
R.string.manager_battery_usage_footer_limited, stateString);
|
||||
} else {
|
||||
//Present default string to normal app.
|
||||
// Present default string to normal app.
|
||||
footerString = context.getString(R.string.manager_battery_usage_footer);
|
||||
}
|
||||
mFooterPreference.setTitle(footerString);
|
||||
|
Reference in New Issue
Block a user