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

Commit fbcf55f7 authored by Louis Chang's avatar Louis Chang
Browse files

Fix PreSimpleSaveActivityTest

#testTapLink_backToPreviousActivityByLaunchingIt test was failed
because the task info and task intent was not propagated from a
finishing task to the newly created task.

Bug: 150145567
Test: atest PreSimpleSaveActivityTest
Test: atest StartActivityTests
Change-Id: I717dc784f730b0e3c78dc3aea0e6e77603443735
parent ca8c810a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3287,7 +3287,7 @@ class ActivityStack extends Task {
        if (DisplayContent.alwaysCreateStack(getWindowingMode(), getActivityType())) {
            // This stack will only contain one task, so just return itself since all stacks ara now
            // tasks and all tasks are now stacks.
            task = reuseAsLeafTask(voiceSession, voiceInteractor, info, activity);
            task = reuseAsLeafTask(voiceSession, voiceInteractor, intent, info, activity);
        } else {
            // Create child task since this stack can contain multiple tasks.
            final int taskId = activity != null
+15 −4
Original line number Diff line number Diff line
@@ -581,10 +581,10 @@ class Task extends WindowContainer<WindowContainer> {
    }

    Task reuseAsLeafTask(IVoiceInteractionSession _voiceSession, IVoiceInteractor _voiceInteractor,
            ActivityInfo info, ActivityRecord activity) {
            Intent intent, ActivityInfo info, ActivityRecord activity) {
        voiceSession = _voiceSession;
        voiceInteractor = _voiceInteractor;
        setIntent(activity);
        setIntent(activity, intent, info);
        setMinDimensions(info);
        return this;
    }
@@ -919,12 +919,23 @@ class Task extends WindowContainer<WindowContainer> {
        return SystemClock.elapsedRealtime() - lastActiveTime;
    }

    /** Sets the original intent, and the calling uid and package. */
    /** @see #setIntent(ActivityRecord, Intent, ActivityInfo) */
    void setIntent(ActivityRecord r) {
        setIntent(r, null /* intent */, null /* info */);
    }

    /**
     * Sets the original intent, and the calling uid and package.
     *
     * @param r The activity that started the task
     * @param intent The task info which could be different from {@code r.intent} if set.
     * @param info The activity info which could be different from {@code r.info} if set.
     */
    void setIntent(ActivityRecord r, @Nullable Intent intent, @Nullable ActivityInfo info) {
        mCallingUid = r.launchedFromUid;
        mCallingPackage = r.launchedFromPackage;
        mCallingFeatureId = r.launchedFromFeatureId;
        setIntent(r.intent, r.info);
        setIntent(intent != null ? intent : r.intent, info != null ? info : r.info);
        setLockTaskAuth(r);

        final WindowContainer parent = getParent();