Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8198deac authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Relax isUserRunning check and allow in-profile calls

Bug 30475753

Change-Id: I739ee7e259f041f5e133edf048b6b54cb7a770db
parent 648d3030
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -21548,8 +21548,9 @@ public final class ActivityManagerService extends ActivityManagerNative
    @Override
    public boolean isUserRunning(int userId, int flags) {
        if (userId != UserHandle.getCallingUserId() && checkCallingPermission(
                INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) {
        if (!mUserController.isSameProfileGroup(userId, UserHandle.getCallingUserId())
                && checkCallingPermission(INTERACT_ACROSS_USERS)
                    != PackageManager.PERMISSION_GRANTED) {
            String msg = "Permission Denial: isUserRunning() from pid="
                    + Binder.getCallingPid()
                    + ", uid=" + Binder.getCallingUid()
+3 −0
Original line number Diff line number Diff line
@@ -1478,6 +1478,9 @@ final class UserController {
    }

    boolean isSameProfileGroup(int callingUserId, int targetUserId) {
        if (callingUserId == targetUserId) {
            return true;
        }
        synchronized (mUserProfileGroupIdsSelfLocked) {
            int callingProfile = mUserProfileGroupIdsSelfLocked.get(callingUserId,
                    UserInfo.NO_PROFILE_GROUP_ID);