Add a skeleton to support battery configucation backup/restore

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I559eed40b05b73e7af5e091115afb11c4ba51068
This commit is contained in:
ykhung
2021-08-13 15:36:53 +08:00
parent cb2ec5399c
commit 96e9685687
3 changed files with 57 additions and 2 deletions

View File

@@ -40,7 +40,8 @@ public class BatteryDiffEntry {
// Caches app label and icon to improve loading performance.
static final Map<String, BatteryEntry.NameAndIcon> sResourceCache = new HashMap<>();
// Whether a specific item is valid to launch restriction page?
static final Map<String, Boolean> sValidForRestriction = new HashMap<>();
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public static final Map<String, Boolean> sValidForRestriction = new HashMap<>();
/** A comparator for {@link BatteryDiffEntry} based on consumed percentage. */
public static final Comparator<BatteryDiffEntry> COMPARATOR =
@@ -339,7 +340,8 @@ public class BatteryDiffEntry {
return builder.toString();
}
static void clearCache() {
/** Clears app icon and label cache data. */
public static void clearCache() {
sResourceCache.clear();
sValidForRestriction.clear();
}