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

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

Merge "Simplify system or active user checks" am: 6062a2d0 am: a0e7a28b

am: c37ae0e2

Change-Id: I7d9f73845ed5f8b11132362c427835801f93d302
parents 9b6adbf0 c37ae0e2
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.