From 279d73889f790ba21d90d1580c7a7fa5283c6166 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 2 Mar 2026 14:41:42 +0000 Subject: [PATCH] Avoid deprecated `AttachConfig::name` API This was replaced by `AttachConfig::thread_name` in jni 0.22.2, which takes a `&JNIStr` and doesn't require an extra allocation for the name to be mutf8 encoded. --- android-activity/src/native_activity/glue.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 67cc6a8..12d37cb 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -886,7 +886,7 @@ fn rust_glue_entry(rust_glue: NativeActivityGlue, activity: *mut ndk_sys::ANativ // For compatibility we attach before calling the applications main function to // allow it to assume the thread is attached before making JNI calls. jvm.attach_current_thread_with_config( - || AttachConfig::new().name("android_main"), + || AttachConfig::new().thread_name(jni::jni_str!("android_main")), Some(16), |env| -> jni::errors::Result<()> { // SAFETY: We know jni_activity is a valid JNI global ref to an Activity instance