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

Commit 0d8b2220 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities am: 2be3ba49

Change-Id: I3429cb8f1ecd7e211ebee8ef3b739d9d4342fdad
parents 0cf31cf4 2be3ba49
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -915,6 +915,8 @@ class ActivityStarter {
        } else {
            callingPid = callingUid = -1;
        }
        boolean forceNewTask = false;
        final int filterCallingUid = callingUid >= 0 ? callingUid : realCallingUid;
        final long origId = Binder.clearCallingIdentity();
        try {
            synchronized (mService) {
@@ -934,6 +936,9 @@ class ActivityStarter {

                    // Don't modify the client's object!
                    intent = new Intent(intent);
                    if (forceNewTask) {
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    }

                    // Collect information about the target of the Intent.
                    ActivityInfo aInfo = mSupervisor.resolveActivity(intent, resolvedTypes[i], 0,
@@ -959,7 +964,17 @@ class ActivityStarter {
                        return res;
                    }

                    resultTo = outActivity[0] != null ? outActivity[0].appToken : null;
                    final ActivityRecord started = outActivity[0];
                    if (started != null && started.getUid() == filterCallingUid) {
                        // Only the started activity which has the same uid as the source caller can
                        // be the caller of next activity.
                        resultTo = started.appToken;
                        forceNewTask = false;
                    } else {
                        // Different apps not adjacent to the caller are forced to be new task.
                        resultTo = null;
                        forceNewTask = true;
                    }
                }
            }
        } finally {