Merge "Adjust background time to avoid background + screen time larger than time slot duration."

This commit is contained in:
TreeHugger Robot
2023-01-11 05:54:55 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 1 deletions

View File

@@ -1547,6 +1547,9 @@ public final class DataProcessor {
appUsageMap,
selectedBatteryEntry.mUserId,
selectedBatteryEntry.mPackageName));
// Make sure the background + screen-on time will not exceed the threshold.
backgroundUsageTimeInMs = Math.min(
backgroundUsageTimeInMs, (long) TOTAL_HOURLY_TIME_THRESHOLD - screenOnTime);
final BatteryDiffEntry currentBatteryDiffEntry = new BatteryDiffEntry(
context,
foregroundUsageTimeInMs,