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

Commit 1a5eba9a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Simplify system or active user checks"

parents 53ef71b5 45bac572
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.