Add PowerSaveWhitelistExceptIdle as Optimizted modes condition
- Check PowerSaveWhitelistExceptIdle list before update each apps optimizaton mode to avoid duplicate remove action - Make those apps which under PowerSaveWhitelistExceptIdle list keep at optimized mode only BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy naming, not edit by this code change Bug: 199892006 Test: make SettingsRoboTests Change-Id: I3cd10cf51b5132fc12a83e9554801ec4e8578cd1 Merged-In: I3cd10cf51b5132fc12a83e9554801ec4e8578cd1
This commit is contained in:
committed by
YUKAI HUNG
parent
e5644441dd
commit
e7cca4cd81
@@ -19,8 +19,8 @@ package com.android.settings.fuelgauge;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.app.backup.BackupManager;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -361,18 +361,20 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
||||
final String stateString;
|
||||
final String footerString;
|
||||
|
||||
if (!mBatteryOptimizeUtils.isValidPackageName()) {
|
||||
//Present optimized only string when the package name is invalid.
|
||||
if (!mBatteryOptimizeUtils.isValidPackageName()
|
||||
|| mBatteryOptimizeUtils.isAllowlistedExceptIdleApp()) {
|
||||
// Present optimized only string when the package name is invalid or
|
||||
// it's in allow list not idle app.
|
||||
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