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

Commit b3ad5676 authored by Russell Brenner's avatar Russell Brenner
Browse files

Add new permission for am.updateLockTaskPackages()

Adds android.permission.UPDATE_LOCK_TASK_PACKAGES, available only to
the system and setup wizard, providing access to
updateLockTaskPackages() without registering with the device policy
manager as a device owner.

Bug: 20016740
Change-Id: I6eceb5cece9407c84eabf3a818bb908f95989b91
parent b2334663
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2975,6 +2975,11 @@
    <permission android:name="android.permission.BIND_VR_LISTENER_SERVICE"
        android:protectionLevel="signature" />

    <!-- Allows an application to whitelist tasks during lock task mode
         @hide <p>Not for use by third-party applications.</p> -->
    <permission android:name="android.permission.UPDATE_LOCK_TASK_PACKAGES"
        android:protectionLevel="signature|setup" />

    <application android:process="system"
                 android:persistent="true"
                 android:hasCode="false"
+2 −1
Original line number Diff line number Diff line
@@ -9823,7 +9823,8 @@ public final class ActivityManagerService extends ActivityManagerNative
    public void updateLockTaskPackages(int userId, String[] packages) {
        final int callingUid = Binder.getCallingUid();
        if (callingUid != 0 && callingUid != Process.SYSTEM_UID) {
            throw new SecurityException("updateLockTaskPackage called from non-system process");
            enforceCallingPermission(android.Manifest.permission.UPDATE_LOCK_TASK_PACKAGES,
                    "updateLockTaskPackages()");
        }
        synchronized (this) {
            if (DEBUG_LOCKTASK) Slog.w(TAG_LOCKTASK, "Whitelisting " + userId + ":" +