From 64f20dd1589c10a3da1544344e033ea0c95962ad Mon Sep 17 00:00:00 2001
From: "Philip P. Moltmann"
Date: Tue, 25 Jun 2019 08:41:51 -0700
Subject: [PATCH] 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
---
core/res/AndroidManifest.xml | 7 ++++
core/res/res/values/attrs_manifest.xml | 2 +
.../SoftRestrictedPermissionPolicy.java | 39 ++++++++++++++++++-
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 890ad5e839f7e..6aff8b8f1d5c6 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 {@code
targetSdkVersion} is 4 or higher.
+ 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.
+ 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.
+
-->
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.
-->
What weak grant means is described in the documentation of
+ the permissions.
-->