From de15edaa9bf486a4050bb067317d313fd807bb10 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 1 Jul 2015 12:30:54 -0700 Subject: Work on issue #21589105: Scope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW... ...to an explicit toggle to enable in Settings Add a new permission flag, saying the permission can be automatically granted to pre-api-23 apps. Apply this to SYSTEM_ALERT_WINDOW. Change-Id: I24a0ceabe7e9f5e458a864d30eda2696ad14a699 --- core/java/android/content/pm/PermissionInfo.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/java/android/content/pm') diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 04dbff2..0a1f148 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -76,6 +76,13 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { public static final int PROTECTION_FLAG_APPOP = 0x40; /** + * Additional flag for {@link #protectionLevel}, corresponding + * to the pre23 value of + * {@link android.R.attr#protectionLevel}. + */ + public static final int PROTECTION_FLAG_PRE23 = 0x80; + + /** * Mask for {@link #protectionLevel}: the basic protection type. */ public static final int PROTECTION_MASK_BASE = 0xf; @@ -171,6 +178,9 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { if ((level&PermissionInfo.PROTECTION_FLAG_APPOP) != 0) { protLevel += "|appop"; } + if ((level&PermissionInfo.PROTECTION_FLAG_PRE23) != 0) { + protLevel += "|pre23"; + } return protLevel; } -- cgit v1.1