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 3805e94129eacfb04c776bff4de308238d5d28fc)
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index bd577598..72a0b33 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -642,10 +642,16 @@
         // 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);
             }