OSDN Git Service

Revert "No direct Uri grants from system."
authorAmith Yamasani <yamasani@google.com>
Mon, 13 Feb 2017 23:43:31 +0000 (23:43 +0000)
committerAmith Yamasani <yamasani@google.com>
Mon, 13 Feb 2017 23:43:31 +0000 (23:43 +0000)
Reason for revert: b/35158271
Bug: 35158271
This reverts commit 2dfe92c2dfbaddd69dabe6e43ab77c4c204c4065.

Change-Id: Id04eab8100bfb0b3e137095b25b7d4b12c6d11e6

services/core/java/com/android/server/am/ActivityManagerService.java

index 8bd7506..f892e52 100644 (file)
@@ -8103,12 +8103,7 @@ public class ActivityManagerService extends IActivityManager.Stub
 
         // Third...  does the caller itself have permission to access
         // this uri?
-        final int callingAppId = UserHandle.getAppId(callingUid);
-        if ((callingAppId == Process.SYSTEM_UID) || (callingAppId == Process.ROOT_UID)) {
-            Slog.w(TAG, "For security reasons, the system cannot issue a Uri permission"
-                    + " grant to " + grantUri + "; use startActivityAsCaller() instead");
-            return -1;
-        } else {
+        if (UserHandle.getAppId(callingUid) != Process.SYSTEM_UID) {
             if (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) {
                 // Require they hold a strong enough Uri permission
                 if (!checkUriPermissionLocked(grantUri, callingUid, modeFlags)) {