From 77cabc750b9d161df62859d223f8b24b400d248b Mon Sep 17 00:00:00 2001 From: shafik Date: Fri, 3 Jan 2020 16:22:50 +0000 Subject: [PATCH] Add permission for MANAGE_EXTERNAL_STORAGE AppOp Add new MANAGE_EXTERNAL_STORAGE permission. Couple it with OP_MANAGE_EXTERNAL_STORAGE. Protection level for the permission is currently signature|appop but will probably change later to |preinstalled. Bug: 146425146 Test: device boots Test: atest CtsPermission2TestCases:android.permission2.cts .RuntimePermissionProperties#allAppOpPermissionNeedAnAppOp Change-Id: I0298ca0f6f463c88b95da6ba9853d061c6983da2 --- api/current.txt | 1 + core/java/android/app/AppOpsManager.java | 5 +++-- core/res/AndroidManifest.xml | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index c734db5196a90..2223375a1604d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -91,6 +91,7 @@ package android { field public static final String KILL_BACKGROUND_PROCESSES = "android.permission.KILL_BACKGROUND_PROCESSES"; field public static final String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE"; field public static final String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS"; + field public static final String MANAGE_EXTERNAL_STORAGE = "android.permission.MANAGE_EXTERNAL_STORAGE"; field public static final String MANAGE_OWN_CALLS = "android.permission.MANAGE_OWN_CALLS"; field public static final String MASTER_CLEAR = "android.permission.MASTER_CLEAR"; field public static final String MEDIA_CONTENT_CONTROL = "android.permission.MEDIA_CONTENT_CONTROL"; diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index 86a5c762240fb..d168572081af7 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -1220,7 +1220,8 @@ public class AppOpsManager { OP_START_FOREGROUND, OP_SMS_FINANCIAL_TRANSACTIONS, OP_MANAGE_IPSEC_TUNNELS, - OP_INSTANT_APP_START_FOREGROUND + OP_INSTANT_APP_START_FOREGROUND, + OP_MANAGE_EXTERNAL_STORAGE, }; /** @@ -1624,7 +1625,7 @@ public class AppOpsManager { null, // no direct permission for OP_READ_DEVICE_IDENTIFIERS Manifest.permission.ACCESS_MEDIA_LOCATION, null, // no permission for OP_QUERY_ALL_PACKAGES - null, // no permission for OP_MANAGE_EXTERNAL_STORAGE + Manifest.permission.MANAGE_EXTERNAL_STORAGE, }; /** diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 7719165aa4026..97114b951e476 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -932,6 +932,14 @@ + + +