Set LEGACY_STORAGE only from READ_EXTERNAL_STORAGE
Not from WRITE_EXTERNAL_STORAGE. Otherwise it is not clear what happens
if one of the permissions is white-listed and one not. This can lead to
a loop where we try to set LEGACY_STORAGE to two different values.
Fixes: 135763654, 135742960
Bug: 135933014
Test: atest RestrictedPermissionsTest
Change-Id: I35883f12525360fd7f760750505a27644342955c
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 890ad5e..6aff8b8 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -824,6 +824,11 @@
grants your app this permission. If you don't need this permission, be sure your <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
targetSdkVersion}</a> is 4 or higher.
+ <p>Is this permission is not whitelisted for an app that targets an API level before
+ {@link android.os.Build.VERSION_CODES#Q} this permission cannot be granted to apps.</p>
+ <p>Is this permission is not whitelisted for an app that targets an API level
+ {@link android.os.Build.VERSION_CODES#Q} or later the app will be forced into isolated storage.
+ </p>
-->
<permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:permissionGroup="android.permission-group.UNDEFINED"
@@ -845,6 +850,8 @@
read/write files in your application-specific directories returned by
{@link android.content.Context#getExternalFilesDir} and
{@link android.content.Context#getExternalCacheDir}.
+ <p>Is this permission is not whitelisted for an app that targets an API level before
+ {@link android.os.Build.VERSION_CODES#Q} this permission cannot be granted to apps.</p>
-->
<permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:permissionGroup="android.permission-group.UNDEFINED"