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

Commit 98b50b34 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make sure to report wait result when clean up activities"

parents 516d750a a59937a8
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2160,8 +2160,7 @@ final class ActivityRecord extends ConfigurationContainer {
        }

        if (nowVisible) {
            // We won't get a call to reportActivityVisibleLocked() so dismiss lockscreen now.
            mStackSupervisor.reportActivityVisibleLocked(this);
            mStackSupervisor.stopWaitingForActivityVisible(this);
        }

        // Schedule an idle timeout in case the app doesn't do it for us.
@@ -2350,7 +2349,7 @@ final class ActivityRecord extends ConfigurationContainer {
            final @LaunchState int launchState = info != null ? info.getLaunchState() : -1;
            mStackSupervisor.reportActivityLaunchedLocked(false /* timeout */, this,
                    windowsDrawnDelayMs, launchState);
            mStackSupervisor.sendWaitingVisibleReportLocked(this);
            mStackSupervisor.stopWaitingForActivityVisible(this);
            finishLaunchTickingLocked();
            if (task != null) {
                task.hasBeenVisible = true;
@@ -2361,7 +2360,7 @@ final class ActivityRecord extends ConfigurationContainer {
    /** Called when the windows associated app window container are visible. */
    public void onWindowsVisible() {
        synchronized (mAtmService.mGlobalLock) {
            mStackSupervisor.reportActivityVisibleLocked(this);
            mStackSupervisor.stopWaitingForActivityVisible(this);
            if (DEBUG_SWITCH) Log.v(TAG_SWITCH, "windowsVisibleLocked(): " + this);
            if (!nowVisible) {
                nowVisible = true;
+2 −10
Original line number Diff line number Diff line
@@ -553,18 +553,10 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        // down to the max limit while they are still waiting to finish.
        mFinishingActivities.remove(r);

        for (int i = mWaitingForActivityVisible.size() - 1; i >= 0; --i) {
            if (mWaitingForActivityVisible.get(i).matches(r.mActivityComponent)) {
                mWaitingForActivityVisible.remove(i);
            }
        }
    }

    void reportActivityVisibleLocked(ActivityRecord r) {
        sendWaitingVisibleReportLocked(r);
        stopWaitingForActivityVisible(r);
    }

    void sendWaitingVisibleReportLocked(ActivityRecord r) {
    void stopWaitingForActivityVisible(ActivityRecord r) {
        boolean changed = false;
        for (int i = mWaitingForActivityVisible.size() - 1; i >= 0; --i) {
            final WaitInfo w = mWaitingForActivityVisible.get(i);
+5 −2
Original line number Diff line number Diff line
@@ -1538,10 +1538,13 @@ class ActivityStarter {
                if (!mAddingToTask && mReuseTask == null) {
                    // We didn't do anything...  but it was needed (a.k.a., client don't use that
                    // intent!)  And for paranoia, make sure we have correctly resumed the top activity.

                    resumeTargetStackIfNeeded();
                    if (outActivity != null && outActivity.length > 0) {
                        outActivity[0] = reusedActivity;
                        // The reusedActivity could be finishing, for example of starting an
                        // activity with FLAG_ACTIVITY_CLEAR_TOP flag. In that case, return the
                        // top running activity in the task instead.
                        outActivity[0] = reusedActivity.finishing
                                ? reusedActivity.getTaskRecord().getTopActivity() : reusedActivity;
                    }

                    return mMovedToFront ? START_TASK_TO_FRONT : START_DELIVERED_TO_TOP;