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

Commit 401e50f8 authored by wilsonshih's avatar wilsonshih
Browse files

Add event log for addToStopping

Bug: 130311385
Test: Build and run, check logs.
Change-Id: I9d4264639415b2b1b79c33803ddcd4bbe0e10f86
parent 0c0106f5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -144,3 +144,6 @@ option java_package com.android.server.am
30064 am_on_top_resumed_gained_called (User|1|5),(Component Name|3),(Reason|3)
# The activity's onTopResumedActivityChanged(false) has been called.
30065 am_on_top_resumed_lost_called (User|1|5),(Component Name|3),(Reason|3)

# An activity been add into stopping list
30066 am_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3)
 No newline at end of file
+9 −4
Original line number Diff line number Diff line
@@ -1822,7 +1822,8 @@ class ActivityStack extends ConfigurationContainer {
                    prev.setDeferHidingClient(false);
                    // If we were visible then resumeTopActivities will release resources before
                    // stopping.
                    addToStopping(prev, true /* scheduleIdle */, false /* idleDelayed */);
                    addToStopping(prev, true /* scheduleIdle */, false /* idleDelayed */,
                            "completePauseLocked");
                }
            } else {
                if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "App died during pause, not stopping: " + prev);
@@ -1883,8 +1884,11 @@ class ActivityStack extends ConfigurationContainer {
        mRootActivityContainer.ensureActivitiesVisible(resuming, 0, !PRESERVE_WINDOWS);
    }

    private void addToStopping(ActivityRecord r, boolean scheduleIdle, boolean idleDelayed) {
    private void addToStopping(ActivityRecord r, boolean scheduleIdle, boolean idleDelayed,
            String reason) {
        if (!mStackSupervisor.mStoppingActivities.contains(r)) {
            EventLog.writeEvent(EventLogTags.AM_ADD_TO_STOPPING, r.mUserId,
                    System.identityHashCode(r), r.shortComponentName, reason);
            mStackSupervisor.mStoppingActivities.add(r);
        }

@@ -2433,7 +2437,7 @@ class ActivityStack extends ConfigurationContainer {
                case PAUSING:
                case PAUSED:
                    addToStopping(r, true /* scheduleIdle */,
                            canEnterPictureInPicture /* idleDelayed */);
                            canEnterPictureInPicture /* idleDelayed */, "makeInvisible");
                    break;

                default:
@@ -4098,7 +4102,8 @@ class ActivityStack extends ConfigurationContainer {
        if (mode == FINISH_AFTER_VISIBLE && (r.visible || r.nowVisible)
                && next != null && !next.nowVisible && !isFloating) {
            if (!mStackSupervisor.mStoppingActivities.contains(r)) {
                addToStopping(r, false /* scheduleIdle */, false /* idleDelayed */);
                addToStopping(r, false /* scheduleIdle */, false /* idleDelayed */,
                        "finishCurrentActivityLocked");
            }
            if (DEBUG_STATES) Slog.v(TAG_STATES,
                    "Moving to STOPPING: "+ r + " (finish requested)");