feat(android): initialise Oboe runtime context

This commit is contained in:
Edison Jwa
2026-05-20 14:52:33 +09:00
parent c87b47f064
commit d6763787aa
4 changed files with 9 additions and 8 deletions
+4 -3
View File
@@ -1,7 +1,7 @@
//! Android-specific JNI lifecycle helpers.
//!
//! On Android the Flutter engine starts our cdylib but does not push
//! anything into `ndk_context` (the global the cpal-on-Oboe backend
//! anything into `ndk_context` (the global the Android Oboe backend
//! reads to find Android audio services). Without that, the first
//! audio call hangs / fails.
//!
@@ -14,7 +14,8 @@
//! application Context. That JNI function pushes both the
//! `JavaVM*` and a `Context` global ref into `ndk_context`.
//!
//! After that, cpal can open the default input/output devices.
//! After that, the Android Oboe backend can open the default
//! input/output devices.
#![cfg(target_os = "android")]
@@ -46,7 +47,7 @@ pub extern "system" fn JNI_OnLoad(
}
/// Called by `MainActivity.onCreate` with the application Context.
/// Initialises the `ndk_context` so cpal's Oboe backend can locate
/// Initialises the `ndk_context` so the Oboe backend can locate
/// the Android audio services.
///
/// Symbol mangling note: Kotlin / JNI mangles the underscore in