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
This commit is contained in:
Andrii Kulian
2017-03-17 10:30:50 -07:00
parent ff8b79e162
commit e6ac20e1c7

View File

@@ -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:"