From d6763787aa2d5359d63a4fddff9565523d1da675 Mon Sep 17 00:00:00 2001 From: Edison Jwa Date: Wed, 20 May 2026 01:37:43 +0900 Subject: [PATCH] feat(android): initialise Oboe runtime context --- .../android/app/src/main/AndroidManifest.xml | 2 +- .../kotlin/app/chanora/chanora_flutter/MainActivity.kt | 6 +++--- crates/chanora_bridge/Cargo.toml | 2 +- crates/chanora_bridge/src/android_init.rs | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/chanora_flutter/android/app/src/main/AndroidManifest.xml b/apps/chanora_flutter/android/app/src/main/AndroidManifest.xml index f0e93c2..6747683 100644 --- a/apps/chanora_flutter/android/app/src/main/AndroidManifest.xml +++ b/apps/chanora_flutter/android/app/src/main/AndroidManifest.xml @@ -34,7 +34,7 @@ related in-call audio routing operations. --> - diff --git a/apps/chanora_flutter/android/app/src/main/kotlin/app/chanora/chanora_flutter/MainActivity.kt b/apps/chanora_flutter/android/app/src/main/kotlin/app/chanora/chanora_flutter/MainActivity.kt index abd9b14..91f2604 100644 --- a/apps/chanora_flutter/android/app/src/main/kotlin/app/chanora/chanora_flutter/MainActivity.kt +++ b/apps/chanora_flutter/android/app/src/main/kotlin/app/chanora/chanora_flutter/MainActivity.kt @@ -29,9 +29,9 @@ class MainActivity : FlutterActivity() { companion object { /** * JNI entry point implemented in `chanora_bridge::android_init`. - * Initialises `ndk_context` with our Activity so cpal-on-Oboe can - * find Android audio services when `chanora_audio` starts the - * capture / playback streams. + * Initialises `ndk_context` with our Activity so the direct Oboe + * backend can find Android audio services when `chanora_audio` + * starts the capture / playback streams. * * Trace: SDD-105 (AndroidJniBootstrap). Signature must remain stable; * the Rust side declares the matching `extern "system"` symbol. diff --git a/crates/chanora_bridge/Cargo.toml b/crates/chanora_bridge/Cargo.toml index 6da0c36..4de253c 100644 --- a/crates/chanora_bridge/Cargo.toml +++ b/crates/chanora_bridge/Cargo.toml @@ -28,7 +28,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros"] } # Android: route `tracing` output to logcat so a user can see protocol # and audio diagnostics via `adb logcat -s chanora`. Also brings in the -# JNI bindings we need to initialise `ndk_context` for cpal-on-Oboe. +# JNI bindings we need to initialise `ndk_context` for the Android Oboe backend. [target.'cfg(target_os = "android")'.dependencies] tracing-android = "0.2" log = "0.4" diff --git a/crates/chanora_bridge/src/android_init.rs b/crates/chanora_bridge/src/android_init.rs index 16eeb8a..f9f187d 100644 --- a/crates/chanora_bridge/src/android_init.rs +++ b/crates/chanora_bridge/src/android_init.rs @@ -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