@Implementation(minSdk = P)
  protected static long nativeOpenAsset(long ptr, @NonNull String asset_path, int access_mode)
      throws FileNotFoundException {
    String asset_path_utf8 = asset_path;
    if (asset_path_utf8 == null) {
      // This will throw NPE.
      return 0;
    }

    ATRACE_NAME(String.format("AssetManager::OpenAsset(%s)", asset_path_utf8));

    if (access_mode != Asset.AccessMode.ACCESS_UNKNOWN.mode()
        && access_mode != Asset.AccessMode.ACCESS_RANDOM.mode()
        && access_mode != Asset.AccessMode.ACCESS_STREAMING.mode()
        && access_mode != Asset.AccessMode.ACCESS_BUFFER.mode()) {
      throw new IllegalArgumentException("Bad access mode");
    }

    CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
    Asset asset =
        assetmanager.Open(asset_path_utf8, Asset.AccessMode.fromInt(access_mode));
    if (!isTruthy(asset)) {
      throw new FileNotFoundException(asset_path_utf8);
    }
    return Registries.NATIVE_ASSET_REGISTRY.register(asset);
  }
@Implementation(minSdk = P)
  protected static long nativeOpenAsset(long ptr, @NonNull String asset_path, int access_mode)
      throws FileNotFoundException {
    String asset_path_utf8 = asset_path;
    if (asset_path_utf8 == null) {
      
      return 0;
    }

    ATRACE_NAME(String.format("AssetManager::OpenAsset(%s)", asset_path_utf8));

    if (access_mode != Asset.AccessMode.ACCESS_UNKNOWN.mode()
        && access_mode != Asset.AccessMode.ACCESS_RANDOM.mode()
        && access_mode != Asset.AccessMode.ACCESS_STREAMING.mode()
        && access_mode != Asset.AccessMode.ACCESS_BUFFER.mode()) {
      throw new IllegalArgumentException("Bad access mode");
    }

    CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
    Asset asset =
        assetmanager.Open(asset_path_utf8, Asset.AccessMode.fromInt(access_mode));
    if (!isTruthy(asset)) {
      throw new FileNotFoundException(asset_path_utf8);
    }
    return Registries.NATIVE_ASSET_REGISTRY.register(asset);
  }
@ Implementation ( minSdk = P ) protected static long nativeOpenAsset ( long ptr , @ NonNull String asset_path , int access_mode ) throws FileNotFoundException { String asset_path_utf8 = asset_path ; if ( asset_path_utf8 == null ) { // This will throw NPE. return 0 ; } ATRACE_NAME ( String . format ( "AssetManager::OpenAsset(%s)" , asset_path_utf8 ) ) ; if ( access_mode != Asset . AccessMode . ACCESS_UNKNOWN . mode ( ) && access_mode != Asset . AccessMode . ACCESS_RANDOM . mode ( ) && access_mode != Asset . AccessMode . ACCESS_STREAMING . mode ( ) && access_mode != Asset . AccessMode . ACCESS_BUFFER . mode ( ) ) { throw new IllegalArgumentException ( "Bad access mode" ) ; } CppAssetManager2 assetmanager = AssetManagerFromLong ( ptr ) ; Asset asset = assetmanager . Open ( asset_path_utf8 , Asset . AccessMode . fromInt ( access_mode ) ) ; if ( ! isTruthy ( asset ) ) { throw new FileNotFoundException ( asset_path_utf8 ) ; } return Registries . NATIVE_ASSET_REGISTRY . register ( asset ) ; }
jint access_mode) {
jint access_mode ) {