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

Commit 6446b230 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Revert "Send RESULT_CANCELED immediately if start-activity-for-result...

Merge "Revert "Send RESULT_CANCELED immediately if start-activity-for-result across TaskFragments"" into tm-qpr-dev
parents ad1cf3ab f3ccee38
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -2565,7 +2565,6 @@ class ActivityStarter {
            mInTask = null;
        }
        mInTaskFragment = inTaskFragment;
        sendNewTaskFragmentResultRequestIfNeeded();

        mStartFlags = startFlags;
        // If the onlyIfNeeded flag is set, then we can do this if the activity being launched
@@ -2608,18 +2607,6 @@ class ActivityStarter {
        }
    }

    private void sendNewTaskFragmentResultRequestIfNeeded() {
        if (mStartActivity.resultTo != null && mInTaskFragment != null
                && mInTaskFragment != mStartActivity.resultTo.getTaskFragment()) {
            Slog.w(TAG,
                    "Activity is launching as a new TaskFragment, so cancelling activity result.");
            mStartActivity.resultTo.sendResult(INVALID_UID, mStartActivity.resultWho,
                    mStartActivity.requestCode, RESULT_CANCELED,
                    null /* data */, null /* dataGrants */);
            mStartActivity.resultTo = null;
        }
    }

    private void computeLaunchingTaskFlags() {
        // If the caller is not coming from another activity, but has given us an explicit task into
        // which they would like us to launch the new activity, then let's see about doing that.