summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Abhijeet Kaur <abkaur@google.com> 2021-08-16 12:06:21 +0100
committer Abhijeet Kaur <abkaur@google.com> 2021-09-10 11:38:43 +0000
commit6fa7ca47ab9a06f6b3dc6afa3c489f7e7061a39f (patch)
treec41cb88587be8f9cd6eedc6a1c486301501a72df
parent4f7f6fba23ab9a234516511bdb3257a5d4d15115 (diff)
Add warning for a known issue in a newly added API
checkUriPermissions is a new API added in Android S to check multiple uri permissions via single API call. However, checkUriPermissions is not working as intended for secondary users. The root cause has been found and the fix is merged for later releases. Bug: 194700183 Test: atest --user-type secondary_user CtsScopedStorageDeviceOnlyTest:android.scopedstorage.cts.device.RedactUriDeviceTest#testSharedRedactedUri_openFileForRead Change-Id: I72db7f0b4ddf97dce14880b6341799106d711c5c
-rw-r--r--core/java/android/content/Context.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 27027721109d..d7d885e5cb8e 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -5935,6 +5935,10 @@ public abstract class Context {
* more general access to the URI's content provider then this check will
* always fail.
*
+ * <strong>Note:</strong> On SDK Version {@link android.os.Build.VERSION_CODES#S},
+ * calling this method from a secondary-user's context will incorrectly return
+ * {@link PackageManager#PERMISSION_DENIED} for all {code uris}.
+ *
* @param uris The list of URIs that is being checked.
* @param pid The process ID being checked against. Must be &gt; 0.
* @param uid The user ID being checked against. A uid of 0 is the root