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

Commit 397fdf0f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Reset launch start times when removing a process"

parents e87700fc 0a389e9e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -5886,6 +5886,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    private final void handleAppDiedLocked(ProcessRecord app,
            boolean restarting, boolean allowRestart) {
        int pid = app.pid;
        final boolean clearLaunchStartTime = !restarting && app.removed && app.foregroundActivities;
        boolean kept = cleanUpApplicationRecordLocked(app, restarting, allowRestart, -1,
                false /*replacingPid*/);
        if (!kept && !restarting) {
@@ -5926,6 +5927,19 @@ public class ActivityManagerService extends IActivityManager.Stub
        } finally {
            mWindowManager.continueSurfaceLayout();
        }
        // TODO (b/67683350)
        // When an app process is removed, activities from the process may be relaunched. In the
        // case of forceStopPackageLocked the activities are finished before any window is drawn,
        // and the launch time is not cleared. This will be incorrectly used to calculate launch
        // time for the next launched activity launched in the same windowing mode.
        if (clearLaunchStartTime) {
            final LaunchTimeTracker.Entry entry = mStackSupervisor
                    .getLaunchTimeTracker().getEntry(mStackSupervisor.getWindowingMode());
            if (entry != null) {
                entry.mLaunchStartTime = 0;
            }
        }
    }
    private final int getLRURecordIndexForAppLocked(IApplicationThread thread) {