Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77cabc75 authored by shafik's avatar shafik
Browse files

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
parent 44e5637c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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";
+3 −2
Original line number Diff line number Diff line
@@ -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,
    };

    /**
+8 −0
Original line number Diff line number Diff line
@@ -932,6 +932,14 @@
    <permission android:name="android.permission.WRITE_OBB"
        android:protectionLevel="signature|privileged" />

    <!-- Allows an application a broad access to external storage in scoped storage.
         Intended to be used by few apps that need to manage files on behalf of the users.
         <p>Protection level: signature|appop
         <p>This protection level is temporary and will most likely be changed to |preinstalled -->
    <permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        android:permissionGroup="android.permission-group.UNDEFINED"
        android:protectionLevel="signature|appop" />

    <!-- ====================================================================== -->
    <!-- Permissions for accessing the device location                          -->
    <!-- ====================================================================== -->