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

Commit 035c20f5 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Add new READ_EXTERNAL_STORAGE permission."

parents bdc5afee 7924512a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ package android {
    field public static final java.lang.String PROCESS_OUTGOING_CALLS = "android.permission.PROCESS_OUTGOING_CALLS";
    field public static final java.lang.String READ_CALENDAR = "android.permission.READ_CALENDAR";
    field public static final java.lang.String READ_CONTACTS = "android.permission.READ_CONTACTS";
    field public static final java.lang.String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";
    field public static final java.lang.String READ_FRAME_BUFFER = "android.permission.READ_FRAME_BUFFER";
    field public static final java.lang.String READ_HISTORY_BOOKMARKS = "com.android.browser.permission.READ_HISTORY_BOOKMARKS";
    field public static final java.lang.String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE";
+43 −2
Original line number Diff line number Diff line
@@ -90,10 +90,24 @@ public class PackageParser {
        }
    }

    /** @hide */
    public static class SplitPermissionInfo {
        public final String rootPerm;
        public final String[] newPerms;

        public SplitPermissionInfo(String rootPerm, String[] newPerms) {
            this.rootPerm = rootPerm;
            this.newPerms = newPerms;
        }
    }

    /**
     * List of new permissions that have been added since 1.0.
     * NOTE: These must be declared in SDK version order, with permissions
     * added to older SDKs appearing before those added to newer SDKs.
     * If sdkVersion is 0, then this is not a permission that we want to
     * automatically add to older apps, but we do want to allow it to be
     * granted during a platform update.
     * @hide
     */
    public static final PackageParser.NewPermissionInfo NEW_PERMISSIONS[] =
@@ -104,6 +118,17 @@ public class PackageParser {
                    android.os.Build.VERSION_CODES.DONUT, 0)
    };

    /**
     * List of permissions that have been split into more granular or dependent
     * permissions.
     * @hide
     */
    public static final PackageParser.SplitPermissionInfo SPLIT_PERMISSIONS[] =
        new PackageParser.SplitPermissionInfo[] {
            new PackageParser.SplitPermissionInfo(android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
                    new String[] { android.Manifest.permission.READ_EXTERNAL_STORAGE })
    };

    private String mArchiveSourcePath;
    private String[] mSeparateProcesses;
    private boolean mOnlyCoreApps;
@@ -1246,6 +1271,22 @@ public class PackageParser {
            Slog.i(TAG, implicitPerms.toString());
        }

        final int NS = PackageParser.SPLIT_PERMISSIONS.length;
        for (int is=0; is<NS; is++) {
            final PackageParser.SplitPermissionInfo spi
                    = PackageParser.SPLIT_PERMISSIONS[is];
            if (!pkg.requestedPermissions.contains(spi.rootPerm)) {
                break;
            }
            for (int in=0; in<spi.newPerms.length; in++) {
                final String perm = spi.newPerms[in];
                if (!pkg.requestedPermissions.contains(perm)) {
                    pkg.requestedPermissions.add(perm);
                    pkg.requestedPermissionsRequired.add(Boolean.TRUE);
                }
            }
        }

        if (supportsSmallScreens < 0 || (supportsSmallScreens > 0
                && pkg.applicationInfo.targetSdkVersion
                        >= android.os.Build.VERSION_CODES.DONUT)) {
+7 −0
Original line number Diff line number Diff line
@@ -639,6 +639,13 @@
        android:label="@string/permgrouplab_storage"
        android:description="@string/permgroupdesc_storage" />

    <!-- Allows an application to read from external storage -->
    <permission android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:permissionGroup="android.permission-group.STORAGE"
        android:label="@string/permlab_sdcardRead"
        android:description="@string/permdesc_sdcardRead"
        android:protectionLevel="dangerous" />

    <!-- Allows an application to write to external storage -->
    <permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:permissionGroup="android.permission-group.STORAGE"
+9 −0
Original line number Diff line number Diff line
@@ -1428,6 +1428,15 @@
    <string name="permdesc_writeDictionary">Allows the app to write new words into the
      user dictionary.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
    <string name="permlab_sdcardRead" product="nosdcard">read USB storage contents</string>
    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_sdcardRead" product="default">read SD card contents</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
    <string name="permdesc_sdcardRead" product="nosdcard">Allows the app to read contents of USB storage.</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_sdcardRead" product="default">Allows the app to read contents of SD card.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
    <string name="permlab_sdcardWrite" product="nosdcard">modify/delete USB storage contents</string>
    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@
        <group gid="log" />
    </permission>

    <permission name="android.permission.READ_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
    </permission>

    <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
        <group gid="sdcard_rw" />
    </permission>
Loading