No STORAGE_PERMISSIONS to grant in new model.
When a developer has enabled the new Q storage model, the legacy
READ/WRITE_EXTERNAL_STORAGE permissions are no longer runtime
permissions, and we shouldn't try granting them any longer, since
they'd fail with a SecurityException.
Bug: 113039719
Test: manual
Change-Id: Idbb246378583832da12576dc17138142f1a6d2f5
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 a78cb33..5befc1f 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -171,8 +171,11 @@
@Deprecated
private static final Set<String> STORAGE_PERMISSIONS = new ArraySet<>();
static {
- STORAGE_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
- STORAGE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ // STOPSHIP(b/112545973): remove once feature enabled by default
+ if (!SystemProperties.getBoolean(StorageManager.PROP_ISOLATED_STORAGE, false)) {
+ STORAGE_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
+ STORAGE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ }
}
private static final Set<String> MEDIA_AURAL_PERMISSIONS = new ArraySet<>();