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

Commit 5236902b 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

Change-Id: I65a2cd55feaa82b16900e00baaba2e5ce5ca285d
parents 8638815a 5fa10b4b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -284,6 +284,14 @@ public final class Utils {
                "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() {
        int callingUser = UserHandle.getCallingUserId();
        int callingUid = Binder.getCallingUid();
+42 −210

File changed.

Preview size limit exceeded, changes collapsed.