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

Commit aee82bf0 authored by Zach Johnson's avatar Zach Johnson Committed by android-build-merger
Browse files

Merge "Simplify system or active user checks" am: 1a5eba9a am: 5fa10b4b

am: 5236902b

Change-Id: I7d9f73845ed5f8b11132362c427835801f93d302
parents d039e55f 5236902b
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -284,6 +284,14 @@ public final class Utils {
                "Need DUMP permission");
                "Need DUMP permission");
    }
    }


    public static boolean callerIsSystemOrActiveUser(String tag, String method) {
        if (!checkCaller()) {
          Log.w(TAG, method + "() - Not allowed for non-active user and non system user");
          return false;
        }
        return true;
    }

    public static boolean checkCaller() {
    public static boolean checkCaller() {
        int callingUser = UserHandle.getCallingUserId();
        int callingUser = UserHandle.getCallingUserId();
        int callingUid = Binder.getCallingUid();
        int callingUid = Binder.getCallingUid();
+42 −210

File changed.

Preview size limit exceeded, changes collapsed.