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

Commit d2cfa859 authored by Zach Johnson's avatar Zach Johnson
Browse files

Simplify system or active user checks

Bug: 145171640
Test: compile, verify stack runs
Change-Id: Ie5d54138f7e6ac76ea1f3d3136009cf8a244d8bf
parent b83dae32
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.