@PermissionResult
    public static int checkSelfPermission(@NonNull Context context,
                                          @NonNull String permission) {
        return checkPermission(context, permission, Process.myPid(),
                Process.myUid(), context.getPackageName());
    }
Checks whether your app has a given permission and whether the app op
that corresponds to this permission is allowed.

@param context    Context for accessing resources.
@param permission The permission to check.
@return The permission check result which is either {@link #PERMISSION_GRANTED}
or {@link #PERMISSION_DENIED} or {@link #PERMISSION_DENIED_APP_OP}.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/PermissionChecker.java