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

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

Merge "Stop supporting System UID to embed a separate task" into tm-dev

parents bf3f189a 0543b212
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -2023,22 +2023,12 @@ class ActivityStarter {
    private boolean canEmbedActivity(@NonNull TaskFragment taskFragment,
            @NonNull ActivityRecord starting, boolean newTask, Task targetTask) {
        final Task hostTask = taskFragment.getTask();
        if (hostTask == null) {
        // Not allowed embedding a separate task or without host task.
        if (hostTask == null || newTask || targetTask != hostTask) {
            return false;
        }

        // Allowing the embedding if the task is owned by system.
        final int hostUid = hostTask.effectiveUid;
        if (UserHandle.getAppId(hostUid) == Process.SYSTEM_UID) {
            return true;
        }

        if (!taskFragment.isAllowedToEmbedActivity(starting)) {
            return false;
        }

        // Not allowed embedding task.
        return !newTask && (targetTask == null || targetTask == hostTask);
        return taskFragment.isAllowedToEmbedActivity(starting);
    }

    /**