Merge "Fix BatteryStats counts foreground activity time."

This commit is contained in:
Treehugger Robot 2022-02-09 06:27:17 +00:00 committed by Gerrit Code Review
commit 982daf25b8

View File

@ -4934,6 +4934,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_STOPPED);
break;
case DESTROYED:
if (app != null && (mVisible || mVisibleRequested)) {
// The app may be died while visible (no PAUSED state).
mAtmService.updateBatteryStats(this, false);
}
mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_DESTROYED);
// Fall through.
case DESTROYING: