fix: crash on launch — don't auto-start call, handle null JNI strings, remove stdout tracing
- CallActivity no longer auto-starts a call on launch - CallViewModel lazily inits engine only when startCall() is called - nativeGetStats nullable return handled safely in Kotlin - Removed tracing_subscriber::fmt() which panics on Android (no stdout) - All JNI calls wrapped in try/catch on Kotlin side Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -109,13 +109,9 @@ pub unsafe extern "system" fn Java_com_wzp_engine_WzpEngine_nativeInit(
|
||||
_class: *mut c_void,
|
||||
) -> JLong {
|
||||
let result = panic::catch_unwind(|| {
|
||||
// Initialise tracing once (ignore errors if already set).
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
let _ = tracing_subscriber::fmt()
|
||||
.with_max_level(tracing::Level::INFO)
|
||||
.try_init();
|
||||
}
|
||||
// Note: tracing on Android requires android_logger or similar.
|
||||
// fmt() subscriber writes to stdout which doesn't exist on Android.
|
||||
// Skip tracing init here — add android_logger later.
|
||||
|
||||
let handle = Box::new(EngineHandle {
|
||||
engine: WzpEngine::new(),
|
||||
|
||||
Reference in New Issue
Block a user