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

Commit 7fd3c296 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Permission to view shared storage for all users." into mnc-dev

parents 6d842f63 32e80d75
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1517,10 +1517,6 @@
    <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
        android:protectionLevel="signature" />

    <!-- Allows an application to access all multi-user external storage @hide -->
    <permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE"
        android:protectionLevel="signature" />

    <!-- @SystemApi Allows an application to modify the current configuration, such
         as locale. -->
    <permission android:name="android.permission.CHANGE_CONFIGURATION"
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@

    <permission name="android.permission.WRITE_MEDIA_STORAGE" >
        <group gid="media_rw" />
        <group gid="sdcard_rw" />
    </permission>

    <permission name="android.permission.ACCESS_MTP" >
+2 −2
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@
    <uses-permission android:name="android.permission.ASEC_DESTROY"/>
    <uses-permission android:name="android.permission.ASEC_MOUNT_UNMOUNT"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- Used to improve MeasureUtils performance on emulated storage -->
    <!-- Used to improve MeasureUtils performance on emulated storage, and to
         view storage for all users -->
    <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
    <uses-permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" />

    <application android:label="@string/service_name"
                 android:allowBackup="false">
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" />
    <!-- Used to read storage for all users -->
    <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <uses-permission android:name="android.permission.INJECT_EVENTS" />
+4 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.pm;
import static android.Manifest.permission.GRANT_REVOKE_PERMISSIONS;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
@@ -2679,7 +2680,9 @@ public class PackageManagerService extends IPackageManager.Stub {
        if (Process.isIsolated(uid)) {
            return Zygote.MOUNT_EXTERNAL_NONE;
        } else {
            if (checkUidPermission(WRITE_EXTERNAL_STORAGE, uid) == PERMISSION_GRANTED) {
            if (checkUidPermission(WRITE_MEDIA_STORAGE, uid) == PERMISSION_GRANTED) {
                return Zygote.MOUNT_EXTERNAL_DEFAULT;
            } else if (checkUidPermission(WRITE_EXTERNAL_STORAGE, uid) == PERMISSION_GRANTED) {
                return Zygote.MOUNT_EXTERNAL_WRITE;
            } else if (checkUidPermission(READ_EXTERNAL_STORAGE, uid) == PERMISSION_GRANTED) {
                return Zygote.MOUNT_EXTERNAL_READ;