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

Commit 33c7520b authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 0b1ec016: am 19d79659: Merge "Fix issue #11374840: adb shell am...

am 0b1ec016: am 19d79659: Merge "Fix issue #11374840: adb shell am startservice not working any more" into klp-dev

* commit '0b1ec016':
  Fix issue #11374840: adb shell am startservice not working any more
parents ee46eab2 0b1ec016
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -12367,7 +12367,6 @@ public final class ActivityManagerService extends ActivityManagerNative
        synchronized(this) {
        synchronized(this) {
            final int callingPid = Binder.getCallingPid();
            final int callingPid = Binder.getCallingPid();
            final int callingUid = Binder.getCallingUid();
            final int callingUid = Binder.getCallingUid();
            checkValidCaller(callingUid, userId);
            final long origId = Binder.clearCallingIdentity();
            final long origId = Binder.clearCallingIdentity();
            ComponentName res = mServices.startServiceLocked(caller, service,
            ComponentName res = mServices.startServiceLocked(caller, service,
                    resolvedType, callingPid, callingUid, userId);
                    resolvedType, callingPid, callingUid, userId);
@@ -12397,8 +12396,6 @@ public final class ActivityManagerService extends ActivityManagerNative
            throw new IllegalArgumentException("File descriptors passed in Intent");
            throw new IllegalArgumentException("File descriptors passed in Intent");
        }
        }
        checkValidCaller(Binder.getCallingUid(), userId);
        synchronized(this) {
        synchronized(this) {
            return mServices.stopServiceLocked(caller, service, resolvedType, userId);
            return mServices.stopServiceLocked(caller, service, resolvedType, userId);
        }
        }
@@ -16389,13 +16386,6 @@ public final class ActivityManagerService extends ActivityManagerNative
        return mUserManager;
        return mUserManager;
    }
    }
    private void checkValidCaller(int uid, int userId) {
        if (UserHandle.getUserId(uid) == userId || uid == Process.SYSTEM_UID || uid == 0) return;
        throw new SecurityException("Caller uid=" + uid
                + " is not privileged to communicate with user=" + userId);
    }
    private int applyUserId(int uid, int userId) {
    private int applyUserId(int uid, int userId) {
        return UserHandle.getUid(userId, uid);
        return UserHandle.getUid(userId, uid);
    }
    }