Support Private Space in battery usage.

- Use database cache for single-user single-profile
- Reload battery usage info in other cases

Bug: 299032923
Test: manual
Change-Id: I5e524a094422639eedbf6e07eda498f3f72fccae
This commit is contained in:
mxyyiyi
2024-03-13 11:16:34 +08:00
parent 470c27b8bd
commit c9e8b8a011
9 changed files with 227 additions and 121 deletions

View File

@@ -556,9 +556,11 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
String.format(
"getBatterySinceLastFullChargeUsageData() size=%d time=%d/ms",
batteryHistoryMap.size(), (System.currentTimeMillis() - start)));
final Map<Integer, Map<Integer, BatteryDiffData>> batteryUsageData =
DataProcessor.getBatteryUsageData(context, batteryHistoryMap);
DataProcessor.getBatteryUsageData(
context,
new UserIdsSeries(context, /* mainUserOnly= */ false),
batteryHistoryMap);
if (batteryUsageData == null) {
return null;
}