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

Commit ddfb2596 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-team Robot
Browse files

Temporary workaround to grant Storage permission.

We have logic that automatically grants the legacy "Storage"
permission when the user grants either of the new "Music" or
"Photos & Videos" permissions, but that logic only lives in
PermissionController, and does not apply to pre-grants.

As a temporary workaround, explicitly grant the "Storage"
permission in pre-grants until we can refactor the
PermissionController logic.

Bug: 124466734
Test: manual
Change-Id: Ic3b07e82092a9100aea89263a1175d9fe2284382
(cherry picked from commit 3805e941)
parent 27207f84
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -642,10 +642,16 @@ public final class DefaultPermissionGrantPolicy {
        // Location
        if (locationPackageNames != null) {
            for (String packageName : locationPackageNames) {
                // STOPSHIP: remove this force-granting of legacy storage
                // permissions once b/124466734 is resolved
                final Set<String> storageWorkaround = new ArraySet<>();
                storageWorkaround.add(Manifest.permission.READ_EXTERNAL_STORAGE);
                storageWorkaround.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);

                grantPermissionsToSystemPackage(packageName, userId,
                        CONTACTS_PERMISSIONS, CALENDAR_PERMISSIONS, MICROPHONE_PERMISSIONS,
                        PHONE_PERMISSIONS, SMS_PERMISSIONS, CAMERA_PERMISSIONS,
                        SENSORS_PERMISSIONS, STORAGE_PERMISSIONS, MEDIA_AURAL_PERMISSIONS);
                        SENSORS_PERMISSIONS, STORAGE_PERMISSIONS, storageWorkaround);
                grantSystemFixedPermissionsToSystemPackage(packageName, userId,
                        LOCATION_PERMISSIONS, ACTIVITY_RECOGNITION_PERMISSIONS);
            }