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

Commit 5782da77 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Report dead activities as paused to stats.

Also tell stats about pause before dispatching to remote side.

Change-Id: I975d0fba65515fa768127792d5aa7976df2ba2d3
parent 7efcc0c1
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2528,10 +2528,6 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
    }
    void reportResumedActivityLocked(ActivityRecord r) {
        updateUsageStats(r, true);
    }
    private void dispatchProcessesChanged() {
        int N;
        synchronized (this) {
+4 −1
Original line number Diff line number Diff line
@@ -788,9 +788,9 @@ final class ActivityStack {
                EventLog.writeEvent(EventLogTags.AM_PAUSE_ACTIVITY,
                        prev.userId, System.identityHashCode(prev),
                        prev.shortComponentName);
                mService.updateUsageStats(prev, false);
                prev.app.thread.schedulePauseActivity(prev.appToken, prev.finishing,
                        userLeaving, prev.configChangeFlags);
                mService.updateUsageStats(prev, false);
            } catch (Exception e) {
                // Ignore exception, if process died other code will cleanup.
                Slog.w(TAG, "Exception thrown during pause", e);
@@ -2883,6 +2883,9 @@ final class ActivityStack {
                                    r.userId, System.identityHashCode(r),
                                    r.task.taskId, r.shortComponentName,
                                    "proc died without state saved");
                            if (r.state == ActivityState.RESUMED) {
                                mService.updateUsageStats(r, false);
                            }
                        }
                        removeActivityFromHistoryLocked(r);

+1 −1
Original line number Diff line number Diff line
@@ -1921,7 +1921,7 @@ public class ActivityStackSupervisor {
    boolean reportResumedActivityLocked(ActivityRecord r) {
        final ActivityStack stack = r.task.stack;
        if (isFrontStack(stack)) {
            mService.reportResumedActivityLocked(r);
            mService.updateUsageStats(r, true);
            mService.setFocusedActivityLocked(r);
        }
        if (allResumedActivitiesComplete()) {