Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing Cobalt APK JNI initialization (#4359)
- Move JNI state variables into a standalone dynamic library to ensure all callers obtain consistent, shared state. - Disable POSIX emulation functions, they run into initialization order conflicts where JNI state isn't available when functions like `close` are already called. - Disable problematic extensions that interact early with JNI - Fix initialization order. Chromium library loader ( LibraryLoader.ensureInitialized ) needs to run and load all dynamic libraries and initialize its JNI environment, before Starboard bridge loads. It also calls `JNI_OnLoad` in `cobalt_library_loader.cc` and passes it a VM pointer. - Restore StarboardBridge native JNI initialization, start the Starboard thread, and enable related minimal modules, including AudioManager and VideoSurfaceView - Ensure JNI_VERSION matches with what Chromium default uses ( JNI_VERSION_1_6 is only used for Cronet, but not elsewhere ). - Ensure initial deeplink variable is never null to prevent crashing early init, use an empty string instead. b/376348543
- Loading branch information