From 8236d331beb992886949a6a1dc90fc3ae40ad99f Mon Sep 17 00:00:00 2001 From: Zimuzo Date: Wed, 29 Aug 2018 10:47:51 +0100 Subject: [PATCH] Restrict MANAGE_DEVICE_ADMIN permissions to signature We want to prevent privileged apps from calling DevicePolicyManager#setActiveAdmin. After this, only apps signed with the platform certificate (e.g Settings / ManagedProvisioning) will be allowed to set Device Admins. Leave @SystemApi so that it is clear that it 'was' a privileged permission, but add @removed to show that it is no longer a privileged permission. Bug: 111153365 Test: atest PermissionsHostTest && atest CtsAdminTestCases Change-Id: I688e87cf09ad206f4f517a7be960c2aa01af8fc4 --- api/system-current.txt | 1 - api/system-removed.txt | 8 ++++++++ core/res/AndroidManifest.xml | 5 +++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 37b5e1e51bda2..2cf6d19eaebbe 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -94,7 +94,6 @@ package android { field public static final java.lang.String MANAGE_CONTENT_CAPTURE = "android.permission.MANAGE_CONTENT_CAPTURE"; field public static final java.lang.String MANAGE_CONTENT_SUGGESTIONS = "android.permission.MANAGE_CONTENT_SUGGESTIONS"; field public static final java.lang.String MANAGE_DEBUGGING = "android.permission.MANAGE_DEBUGGING"; - field public static final java.lang.String MANAGE_DEVICE_ADMINS = "android.permission.MANAGE_DEVICE_ADMINS"; field public static final java.lang.String MANAGE_IPSEC_TUNNELS = "android.permission.MANAGE_IPSEC_TUNNELS"; field public static final java.lang.String MANAGE_ROLE_HOLDERS = "android.permission.MANAGE_ROLE_HOLDERS"; field public static final java.lang.String MANAGE_ROLLBACKS = "android.permission.MANAGE_ROLLBACKS"; diff --git a/api/system-removed.txt b/api/system-removed.txt index 4beb69920e28d..5a7ec8bd09bd3 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -1,3 +1,11 @@ +package android { + + public static final class Manifest.permission { + field public static final java.lang.String MANAGE_DEVICE_ADMINS = "android.permission.MANAGE_DEVICE_ADMINS"; + } + +} + package android.app { public class Notification implements android.os.Parcelable { diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 2f3a4910bf83f..36a9097e15acd 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -3196,9 +3196,10 @@ + @hide + @removed --> + android:protectionLevel="signature" />