Loading services/core/java/com/android/server/pm/CrossProfileAppsServiceImpl.java +10 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub { android.Manifest.permission.INTERACT_ACROSS_PROFILES, callingUid, -1, true); if (permissionFlag != PackageManager.PERMISSION_GRANTED || !mInjector.getUserManager().isSameProfileGroup(callerUserId, userId)) { || !isSameProfileGroup(callerUserId, userId)) { throw new SecurityException("Attempt to launch activity without required " + android.Manifest.permission.INTERACT_ACROSS_PROFILES + " permission" + " or target user is not in the same profile group."); Loading Loading @@ -209,6 +209,15 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub { } } private boolean isSameProfileGroup(@UserIdInt int callerUserId, @UserIdInt int userId) { final long ident = mInjector.clearCallingIdentity(); try { return mInjector.getUserManager().isSameProfileGroup(callerUserId, userId); } finally { mInjector.restoreCallingIdentity(ident); } } /** * Verify that the given calling package is belong to the calling UID. */ Loading Loading
services/core/java/com/android/server/pm/CrossProfileAppsServiceImpl.java +10 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub { android.Manifest.permission.INTERACT_ACROSS_PROFILES, callingUid, -1, true); if (permissionFlag != PackageManager.PERMISSION_GRANTED || !mInjector.getUserManager().isSameProfileGroup(callerUserId, userId)) { || !isSameProfileGroup(callerUserId, userId)) { throw new SecurityException("Attempt to launch activity without required " + android.Manifest.permission.INTERACT_ACROSS_PROFILES + " permission" + " or target user is not in the same profile group."); Loading Loading @@ -209,6 +209,15 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub { } } private boolean isSameProfileGroup(@UserIdInt int callerUserId, @UserIdInt int userId) { final long ident = mInjector.clearCallingIdentity(); try { return mInjector.getUserManager().isSameProfileGroup(callerUserId, userId); } finally { mInjector.restoreCallingIdentity(ident); } } /** * Verify that the given calling package is belong to the calling UID. */ Loading