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

Commit ca44dbbb authored by Hani Kazmi's avatar Hani Kazmi Committed by Automerger Merge Worker
Browse files

Merge "ASM - Allow sources to launch into own task with NEW_TASK" into udc-dev am: 60d3c059

parents 8001d7b2 60d3c059
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class ActivitySecurityModelFeatureFlags {
    static final String DOC_LINK = "go/android-asm";

    /** Used to determine which version of the ASM logic was used in logs while we iterate */
    static final int ASM_VERSION = 5;
    static final int ASM_VERSION = 6;

    private static final String NAMESPACE = NAMESPACE_WINDOW_MANAGER;
    private static final String KEY_ASM_PREFIX = "ActivitySecurity__";
+6 −2
Original line number Diff line number Diff line
@@ -1948,9 +1948,13 @@ class ActivityStarter {
            boolean passesAsmChecks = true;
            Task sourceTask = mSourceRecord.getTask();

            // Don't allow launches into a new task if the current task is not foreground.
            // Allow launching into a new task (or a task matching the launched activity's
            // affinity) only if the current task is foreground or mutating its own task.
            // The latter can happen eg. if caller uses NEW_TASK flag and the activity being
            // launched matches affinity of source task.
            if (taskToFront) {
                passesAsmChecks = sourceTask != null && sourceTask.isVisible();
                passesAsmChecks = sourceTask != null
                        && (sourceTask.isVisible() || sourceTask == targetTask);
            }

            if (passesAsmChecks) {