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

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

Merge "Fix unminimizing dock stack for AppTask.moveToFront" into nyc-dev

parents a092b6cd 6afd1564
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4404,6 +4404,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
                    "startActivityFromRecentsInner: Task " + taskId + " not found.");
        }

        // Since we don't have an actual source record here, we assume that the currently focused
        // activity was the source.
        final ActivityStack focusedStack = getFocusedStack();
        final ActivityRecord sourceRecord =
                focusedStack != null ? focusedStack.topActivity() : null;

        if (launchStackId != INVALID_STACK_ID) {
            if (task.stack.mStackId != launchStackId) {
                moveTaskToStackLocked(
@@ -4427,6 +4433,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
            if (launchStackId == DOCKED_STACK_ID) {
                setResizingDuringAnimation(taskId);
            }

            mService.mActivityStarter.postStartActivityUncheckedProcessing(task.getTopActivity(),
                    ActivityManager.START_TASK_TO_FRONT,
                    sourceRecord != null ? sourceRecord.task.stack.mStackId : INVALID_STACK_ID,
                    sourceRecord, task.stack);
            return ActivityManager.START_TASK_TO_FRONT;
        }
        callingUid = task.mCallingUid;
+9 −7
Original line number Diff line number Diff line
@@ -536,12 +536,13 @@ class ActivityStarter {
        } finally {
            mService.mWindowManager.continueSurfaceLayout();
        }
        postStartActivityUncheckedProcessing(r, err, stack.mStackId);
        postStartActivityUncheckedProcessing(r, err, stack.mStackId, mSourceRecord, mTargetStack);
        return err;
    }

    void postStartActivityUncheckedProcessing(
            ActivityRecord r, int result, int prevFocusedStackId) {
            ActivityRecord r, int result, int prevFocusedStackId, ActivityRecord sourceRecord,
            ActivityStack targetStack) {

        if (result < START_SUCCESS) {
            // If someone asked to have the keyguard dismissed on the next activity start,
@@ -555,7 +556,7 @@ class ActivityStarter {
        if (r.task != null && r.task.stack != null) {
            startedActivityStackId = r.task.stack.mStackId;
        } else if (mTargetStack != null) {
            startedActivityStackId = mTargetStack.mStackId;
            startedActivityStackId = targetStack.mStackId;
        }

        // If we launched the activity from a no display activity that was launched from the home
@@ -563,9 +564,9 @@ class ActivityStarter {
        // noDisplay activity will be finished shortly after.
        // TODO: We should prevent noDisplay activities from affecting task/stack ordering and
        // visibility instead of using this flag.
        final boolean noDisplayActivityOverHome = mSourceRecord != null
                && mSourceRecord.noDisplay
                && mSourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE;
        final boolean noDisplayActivityOverHome = sourceRecord != null
                && sourceRecord.noDisplay
                && sourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE;
        if (startedActivityStackId == DOCKED_STACK_ID
                && (prevFocusedStackId == HOME_STACK_ID || noDisplayActivityOverHome)) {
            final ActivityStack homeStack = mSupervisor.getStack(HOME_STACK_ID);
@@ -1788,7 +1789,8 @@ class ActivityStarter {
                final int result = startActivityUnchecked(
                        pal.r, pal.sourceRecord, null, null, pal.startFlags, resume, null, null);
                postStartActivityUncheckedProcessing(
                        pal.r, result, mSupervisor.mFocusedStack.mStackId);
                        pal.r, result, mSupervisor.mFocusedStack.mStackId, mSourceRecord,
                        mTargetStack);
            } catch (Exception e) {
                Slog.e(TAG, "Exception during pending activity launch pal=" + pal, e);
                pal.sendErrorResult(e.getMessage());