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

Commit 7e1f5788 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Migrate task intent/info to new task only if source task is empty" into...

Merge "Migrate task intent/info to new task only if source task is empty" into tm-dev am: df3e2162

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17739083



Change-Id: I57e0bf1e3e6cf7bfbde557d649b8ecd0594cc12e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c875a67a df3e2162
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -2644,15 +2644,17 @@ class ActivityStarter {
            Slog.w(TAG, "startActivity called from finishing " + mSourceRecord
                    + "; forcing " + "Intent.FLAG_ACTIVITY_NEW_TASK for: " + mIntent);
            mLaunchFlags |= FLAG_ACTIVITY_NEW_TASK;
            mNewTaskInfo = mSourceRecord.info;

            // It is not guaranteed that the source record will have a task associated with it. For,
            // example, if this method is being called for processing a pending activity launch, it
            // is possible that the activity has been removed from the task after the launch was
            // enqueued.
            // It is not guaranteed that the source record will have a task associated with it.
            // For example, if this method is being called for processing a pending activity
            // launch, it is possible that the activity has been removed from the task after the
            // launch was enqueued.
            final Task sourceTask = mSourceRecord.getTask();
            if (sourceTask == null || sourceTask.getTopNonFinishingActivity() == null) {
                mNewTaskInfo = mSourceRecord.info;
                mNewTaskIntent = sourceTask != null ? sourceTask.intent : null;
            }
        }
        mSourceRecord = null;
        mSourceRootTask = null;
    }