From 6ad2d66072795dd9836350b273dcde52910ab4c3 Mon Sep 17 00:00:00 2001 From: Billy Lau Date: Sat, 18 Jul 2015 00:26:58 +0100 Subject: Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes) AppOpsManager: Changed the default operating mode for WRITE_SETTINGS to MODE_DEFAULT from MODE_ALLOWED. packages/SettingsProvider: We no longer do static permission checks for WRITE_SETTINGS in early checks and defer that to app op when MODE_DEFAULT is returned. For some operations, checking against WRITE_SECURE_SETTINGS is sufficient. ActivityManagerService & PowerManagerService: Incorporated app op checks and handled the MODE_DEFAULT case. provider/Settings: Added helper function to do checks on whether app ops protected operations can be performed by a caller. This includes checks for WRITE_SETTINGS and SYSTEM_ALERT_WINDOW. Also added a public API (with javadocs) for apps to query if they can modify system settings. Changed the javadocs description for ACTION_MANAGE_WRITE_SETTINGS and ACTION_MANAGE_OVERLAY_PERMISSION. Added public API (with javadocs) for apps to query whether they can draw overlays or not, and also javadocs description on how to use that check. Change-Id: I7b651fe8af836c2074defdbd6acfec3f32acdbe9 --- api/current.txt | 2 ++ api/system-current.txt | 2 ++ 2 files changed, 4 insertions(+) (limited to 'api') diff --git a/api/current.txt b/api/current.txt index 7f788a5..72e0447 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26404,6 +26404,7 @@ package android.provider { public final class Settings { ctor public Settings(); + method public static boolean canDrawOverlays(android.content.Context); field public static final java.lang.String ACTION_ACCESSIBILITY_SETTINGS = "android.settings.ACCESSIBILITY_SETTINGS"; field public static final java.lang.String ACTION_ADD_ACCOUNT = "android.settings.ADD_ACCOUNT_SETTINGS"; field public static final java.lang.String ACTION_AIRPLANE_MODE_SETTINGS = "android.settings.AIRPLANE_MODE_SETTINGS"; @@ -26623,6 +26624,7 @@ package android.provider { public static final class Settings.System extends android.provider.Settings.NameValueTable { ctor public Settings.System(); + method public static boolean canWrite(android.content.Context); method public static void getConfiguration(android.content.ContentResolver, android.content.res.Configuration); method public static float getFloat(android.content.ContentResolver, java.lang.String, float); method public static float getFloat(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; diff --git a/api/system-current.txt b/api/system-current.txt index 4ef1719..65214b8 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -28463,6 +28463,7 @@ package android.provider { public final class Settings { ctor public Settings(); + method public static boolean canDrawOverlays(android.content.Context); field public static final java.lang.String ACTION_ACCESSIBILITY_SETTINGS = "android.settings.ACCESSIBILITY_SETTINGS"; field public static final java.lang.String ACTION_ADD_ACCOUNT = "android.settings.ADD_ACCOUNT_SETTINGS"; field public static final java.lang.String ACTION_AIRPLANE_MODE_SETTINGS = "android.settings.AIRPLANE_MODE_SETTINGS"; @@ -28683,6 +28684,7 @@ package android.provider { public static final class Settings.System extends android.provider.Settings.NameValueTable { ctor public Settings.System(); + method public static boolean canWrite(android.content.Context); method public static void getConfiguration(android.content.ContentResolver, android.content.res.Configuration); method public static float getFloat(android.content.ContentResolver, java.lang.String, float); method public static float getFloat(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; -- cgit v1.1