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

Commit e6ac20e1 authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Allow holders of MANAGE_ACTIVITY_STACKS to launch on private displays

MANAGE_ACTIVITY_STACKS permission allows moving stacks, tasks and
activities between corresponding parents. It makes no sense to
require more strict START_ANY_ACTIVITY permission to launch on
private display, as an activity still can be moved to it.

Bug: 34164473
Test: 'adb unroot' and run android.server.cts.ActivityManagerDisplayTests
Change-Id: I3b59127829c432e42a46630025eeddd152bce1b0
parent ff8b79e1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.am;

import static android.Manifest.permission.MANAGE_ACTIVITY_STACKS;
import static android.Manifest.permission.START_ANY_ACTIVITY;
import static android.Manifest.permission.START_TASKS_FROM_RECENTS;
import static android.app.ActivityManager.LOCK_TASK_MODE_LOCKED;
@@ -1612,8 +1613,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
            return true;
        }

        // Check if the caller can launch anything.
        final int startAnyPerm = mService.checkPermission(START_ANY_ACTIVITY, callingPid,
        // Check if the caller can manage activity stacks.
        final int startAnyPerm = mService.checkPermission(MANAGE_ACTIVITY_STACKS, callingPid,
                callingUid);
        if (startAnyPerm == PERMISSION_GRANTED) {
            if (DEBUG_TASKS) Slog.d(TAG, "Launch on display check:"