[B&R] avoid to backup & restore app which is in the PowerSaveWhitelistExceptIdle

BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy method name

Test command for backup manager:
adb shell bmgr backupnow com.android.settings
adb shell dumpsys backup | grep Current
adb shell bmgr restore 3e9867a7660315b8 com.android.settings

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I78f34870af3146698e6d1b9fbc5ec4385a8d5384
This commit is contained in:
ykhung
2021-09-23 16:56:07 +08:00
parent 8ab5c92adc
commit 9de5fe158d
2 changed files with 21 additions and 3 deletions

View File

@@ -263,7 +263,9 @@ public final class BatteryBackupHelper implements BackupHelper {
private boolean isSystemOrDefaultApp(String packageName) {
final PowerAllowlistBackend powerAllowlistBackend = getPowerAllowlistBackend();
return powerAllowlistBackend.isSysAllowlisted(packageName)
|| powerAllowlistBackend.isDefaultActiveApp(packageName);
|| powerAllowlistBackend.isDefaultActiveApp(packageName)
// Optimize mode only for app which is in the allow list not idle app.
|| powerAllowlistBackend.isAllowlistedExceptIdle(packageName);
}
private List<ApplicationInfo> getInstalledApplications() {