diff options
| author | 2015-07-08 00:31:01 +0100 | |
|---|---|---|
| committer | 2015-07-12 22:41:00 +0100 | |
| commit | 22b3f4cb15207239e203d5ec8b72ec6bc90fef35 (patch) | |
| tree | f31bf89fd6b9e468571592fd366c0b66f4306a90 | |
| parent | 4ccf69e1191244ee104edd74843fc7ae391c5270 (diff) | |
Bug: 21589105 Rescope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW permission
Raised the protection level of WRITE_SETTINGS permission to appop and also
allowed backwards compatibility with pre23 flag. Also made sure that this
permission is not added as RuntimePermission in DefaultPermissionGrantPolicy as
that breaks a lot of gmscore stuff.
Introduced new action to manage write system settings as a new API and
renamed the string that describes the managing of overlay permission.
Change-Id: Ifd25a6ddc06de68ee37015cb9fb23452e4ef10f4
| -rw-r--r-- | api/current.txt | 3 | ||||
| -rw-r--r-- | api/system-current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 17 | ||||
| -rw-r--r-- | core/res/AndroidManifest.xml | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java | 1 |
5 files changed, 21 insertions, 5 deletions
diff --git a/api/current.txt b/api/current.txt index af9586756bce..0af9117d1de5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26405,7 +26405,8 @@ package android.provider { field public static final java.lang.String ACTION_LOCATION_SOURCE_SETTINGS = "android.settings.LOCATION_SOURCE_SETTINGS"; field public static final java.lang.String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; field public static final java.lang.String ACTION_MANAGE_APPLICATIONS_SETTINGS = "android.settings.MANAGE_APPLICATIONS_SETTINGS"; - field public static final java.lang.String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.MANAGE_OVERLAY_PERMISSION"; + field public static final java.lang.String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION"; + field public static final java.lang.String ACTION_MANAGE_WRITE_SETTINGS = "android.settings.action.MANAGE_WRITE_SETTINGS"; field public static final java.lang.String ACTION_MEMORY_CARD_SETTINGS = "android.settings.MEMORY_CARD_SETTINGS"; field public static final java.lang.String ACTION_NETWORK_OPERATOR_SETTINGS = "android.settings.NETWORK_OPERATOR_SETTINGS"; field public static final java.lang.String ACTION_NFCSHARING_SETTINGS = "android.settings.NFCSHARING_SETTINGS"; diff --git a/api/system-current.txt b/api/system-current.txt index 9fce166b2153..dea106325754 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -28461,7 +28461,8 @@ package android.provider { field public static final java.lang.String ACTION_LOCATION_SOURCE_SETTINGS = "android.settings.LOCATION_SOURCE_SETTINGS"; field public static final java.lang.String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; field public static final java.lang.String ACTION_MANAGE_APPLICATIONS_SETTINGS = "android.settings.MANAGE_APPLICATIONS_SETTINGS"; - field public static final java.lang.String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.MANAGE_OVERLAY_PERMISSION"; + field public static final java.lang.String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION"; + field public static final java.lang.String ACTION_MANAGE_WRITE_SETTINGS = "android.settings.action.MANAGE_WRITE_SETTINGS"; field public static final java.lang.String ACTION_MEMORY_CARD_SETTINGS = "android.settings.MEMORY_CARD_SETTINGS"; field public static final java.lang.String ACTION_NETWORK_OPERATOR_SETTINGS = "android.settings.NETWORK_OPERATOR_SETTINGS"; field public static final java.lang.String ACTION_NFCSHARING_SETTINGS = "android.settings.NFCSHARING_SETTINGS"; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 4e1375891337..fff355b452ce 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -574,7 +574,22 @@ public final class Settings { */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_MANAGE_OVERLAY_PERMISSION = - "android.settings.MANAGE_OVERLAY_PERMISSION"; + "android.settings.action.MANAGE_OVERLAY_PERMISSION"; + + /** + * Activity Action: Show settings to toggle apps' capablity to + * to read/write system settings. + * <p> + * In some cases, a matching Activity may not exist, so ensure you + * safeguard against this. + * <p> + * Input: Nothing. + * <p> + * Output: Nothing. + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_MANAGE_WRITE_SETTINGS = + "android.settings.action.MANAGE_WRITE_SETTINGS"; /** * Activity Action: Show screen of details about a particular application. diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 0617b4fe71f3..f7c446bf3b0d 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1538,7 +1538,7 @@ <permission android:name="android.permission.WRITE_SETTINGS" android:label="@string/permlab_writeSettings" android:description="@string/permdesc_writeSettings" - android:protectionLevel="dangerous" /> + android:protectionLevel="signature|preinstalled|appop|pre23" /> <!-- @SystemApi Allows an application to modify the Google service map. <p>Not for use by third-party applications. --> diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java index ec883b9e6390..bca0866baa41 100644 --- a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java +++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java @@ -261,7 +261,6 @@ final class DefaultPermissionGrantPolicy { && doesPackageSupportRuntimePermissions(setupPackage)) { grantRuntimePermissionsLPw(setupPackage, PHONE_PERMISSIONS, userId); grantRuntimePermissionsLPw(setupPackage, CONTACTS_PERMISSIONS, userId); - grantRuntimePermissionsLPw(setupPackage, SETTINGS_PERMISSIONS, userId); } // Camera |