Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0f95ff0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update PAUSE usage state when activity move from RESUMED to STOPPING" into main

parents 8238a470 292ae8c0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5877,6 +5877,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return;
        }

        final State prevState = mState;
        mState = state;

        if (getTaskFragment() != null) {
@@ -5917,6 +5918,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                mAtmService.updateBatteryStats(this, false);
                mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_PAUSED);
                break;
            case STOPPING:
                // It is possible that an Activity is scheduled to be STOPPED directly from RESUMED
                // state. Updating the PAUSED usage state in that case, since the Activity will be
                // STOPPED while cycled through the PAUSED state.
                if (prevState == RESUMED) {
                    mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_PAUSED);
                }
                break;
            case STOPPED:
                mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_STOPPED);
                if (mDisplayContent != null) {