Loading services/core/java/com/android/server/am/ActivityManagerService.java +16 −8 Original line number Diff line number Diff line Loading @@ -9711,15 +9711,10 @@ public final class ActivityManagerService extends ActivityManagerNative long ident = 0; boolean clearedIdentity = false; userId = unsafeConvertIncomingUser(userId); if (UserHandle.getUserId(callingUid) != userId) { if (checkComponentPermission(INTERACT_ACROSS_USERS, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED || checkComponentPermission(INTERACT_ACROSS_USERS_FULL, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED) { if (canClearIdentity(callingPid, callingUid, userId)) { clearedIdentity = true; ident = Binder.clearCallingIdentity(); } } ContentProviderHolder holder = null; try { holder = getContentProviderExternalUnchecked(name, null, userId); Loading @@ -9746,6 +9741,19 @@ public final class ActivityManagerService extends ActivityManagerNative return null; } private boolean canClearIdentity(int callingPid, int callingUid, int userId) { if (UserHandle.getUserId(callingUid) == userId) { return true; } if (checkComponentPermission(INTERACT_ACROSS_USERS, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED || checkComponentPermission(INTERACT_ACROSS_USERS_FULL, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED) { return true; } return false; } // ========================================================= // GLOBAL MANAGEMENT // ========================================================= Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +16 −8 Original line number Diff line number Diff line Loading @@ -9711,15 +9711,10 @@ public final class ActivityManagerService extends ActivityManagerNative long ident = 0; boolean clearedIdentity = false; userId = unsafeConvertIncomingUser(userId); if (UserHandle.getUserId(callingUid) != userId) { if (checkComponentPermission(INTERACT_ACROSS_USERS, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED || checkComponentPermission(INTERACT_ACROSS_USERS_FULL, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED) { if (canClearIdentity(callingPid, callingUid, userId)) { clearedIdentity = true; ident = Binder.clearCallingIdentity(); } } ContentProviderHolder holder = null; try { holder = getContentProviderExternalUnchecked(name, null, userId); Loading @@ -9746,6 +9741,19 @@ public final class ActivityManagerService extends ActivityManagerNative return null; } private boolean canClearIdentity(int callingPid, int callingUid, int userId) { if (UserHandle.getUserId(callingUid) == userId) { return true; } if (checkComponentPermission(INTERACT_ACROSS_USERS, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED || checkComponentPermission(INTERACT_ACROSS_USERS_FULL, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED) { return true; } return false; } // ========================================================= // GLOBAL MANAGEMENT // ========================================================= Loading