Commit bd7f6a82 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Simon Shields

Always create grant structures when persistable.

Certain apps may already hold permissions to an underlying provider,
but they expect APIs like takePersistableUriPermission() and
getPersistedUriPermissions() to work when a permission grant was
extended with FLAG_GRANT_PERSISTABLE_URI_PERMISSION.

Test: builds, boots
Bug: 31239684
Change-Id: I4b21c57956b70133ecadb50d0d3ee339f41e2260
parent bf76beec
......@@ -8297,6 +8297,12 @@ public final class ActivityManagerService extends ActivityManagerNative
}
}
// If we're extending a persistable grant, then we always need to create
// the grant data structure so that take/release APIs work
if ((modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0) {
return targetUid;
}
if (targetUid >= 0) {
// First... does the target actually need this permission?
if (checkHoldingPermissionsLocked(pm, pi, grantUri, targetUid, modeFlags)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment