diff options
| author | 2018-08-08 17:23:00 -0700 | |
|---|---|---|
| committer | 2018-08-08 17:23:00 -0700 | |
| commit | 1e4d88926f6ec3e9fb038afda888f709cd9bc845 (patch) | |
| tree | b16a5166e65241730eb58f3b4eab4228c5511c91 | |
| parent | c93b474752483e7e99e63709f8511ca76c235680 (diff) | |
| parent | 05519b7e3d0f3d16ddfe6ee3892c8468a2c10c62 (diff) | |
DO NOT MERGE. Persistable Uri grants still require permissions.
am: 05519b7e3d
Change-Id: I6d42f089fec6c268b35885d3169644853ab734c5
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 17a813752852..aef7cc5ca4b7 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8737,10 +8737,17 @@ public class ActivityManagerService extends IActivityManager.Stub } } - // If we're extending a persistable grant, then we always need to create - // the grant data structure so that take/release APIs work + // Figure out the value returned when access is allowed + final int allowedResult; if ((modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0) { - return targetUid; + // If we're extending a persistable grant, then we need to return + // "targetUid" so that we always create a grant data structure to + // support take/release APIs + allowedResult = targetUid; + } else { + // Otherwise, we can return "-1" to indicate that no grant data + // structures need to be created + allowedResult = -1; } if (targetUid >= 0) { @@ -8749,7 +8756,7 @@ public class ActivityManagerService extends IActivityManager.Stub // No need to grant the target this permission. if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Target " + targetPkg + " already has full permission to " + grantUri); - return -1; + return allowedResult; } } else { // First... there is no target package, so can anyone access it? @@ -8765,7 +8772,7 @@ public class ActivityManagerService extends IActivityManager.Stub } } if (allowed) { - return -1; + return allowedResult; } } |