MCPcopy Create free account
hub / github.com/Snapchat/Valdi / updateResource

Method updateResource

valdi/src/valdi/android/NativeBridge.cpp:442–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442void ValdiAndroid::NativeBridge::updateResource( // NOLINT
443 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
444 jlong runtimeHandle,
445 jbyteArray resource,
446 jstring bundleName,
447 jstring filePathWithinBundle) {
448 auto* runtime = getRuntime(runtimeHandle);
449 if (runtime == nullptr) {
450 return;
451 }
452
453 auto javaEnv = ValdiAndroid::JavaEnv();
454 auto bytes = ValdiAndroid::toByteArray(javaEnv, resource);
455 auto cppBundleName = ValdiAndroid::toInternedString(javaEnv, bundleName);
456 auto cppFilePathWithinBundle = ValdiAndroid::toInternedString(javaEnv, filePathWithinBundle);
457
458 runtime->updateResource(bytes, cppBundleName, cppFilePathWithinBundle);
459}
460
461/*
462 * Class: snapchat_valdi_nativebridge_ValdiNativeBridge

Callers

nothing calls this directly

Calls 4

getRuntimeFunction · 0.85
toInternedStringFunction · 0.85
JavaEnvClass · 0.50
toByteArrayFunction · 0.50

Tested by

no test coverage detected