static int checkOpNoThrow(@Nullable AppOpsManager appOpsManager,
                                  @NonNull String op, int uid, @NonNull String packageName) {
            if (appOpsManager == null) {
                return MODE_IGNORED;
            }

            return appOpsManager.checkOpNoThrow(op, uid, packageName);
        }
Use the AppOpsManager to perform checkOp().
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/AppOpsManagerCompat.java