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

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

Merge "Do not update calling pid/uid if the task cannot be relinquished" into sc-dev

parents 965c170d 1d689704
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -1260,10 +1260,13 @@ class Task extends WindowContainer<WindowContainer> {
     * @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) {
        if (this.intent == null || !mNeverRelinquishIdentity) {
            mCallingUid = r.launchedFromUid;
            mCallingPackage = r.launchedFromPackage;
            mCallingFeatureId = r.launchedFromFeatureId;
            setIntent(intent != null ? intent : r.intent, info != null ? info : r.info);
            return;
        }
        setLockTaskAuth(r);
    }

@@ -1271,13 +1274,7 @@ class Task extends WindowContainer<WindowContainer> {
    private void setIntent(Intent _intent, ActivityInfo info) {
        if (!isLeafTask()) return;

        if (intent == null) {
            mNeverRelinquishIdentity =
                    (info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
        } else if (mNeverRelinquishIdentity) {
            return;
        }

        mNeverRelinquishIdentity = (info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
        affinity = info.taskAffinity;
        if (intent == null) {
            // If this task already has an intent associated with it, don't set the root