From 7a462efb57869657d429801b6726e803bdf269f2 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Mon, 28 Oct 2024 14:35:54 -0400 Subject: [PATCH] Ensure examples compile on latest version of AOSP (#2414) This is part of #2398. --- src/android/interoperability/java/src/lib.rs | 6 +++--- src/android/logging/src/main.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/android/interoperability/java/src/lib.rs b/src/android/interoperability/java/src/lib.rs index af2acafd2ee..ece8b97b7d8 100644 --- a/src/android/interoperability/java/src/lib.rs +++ b/src/android/interoperability/java/src/lib.rs @@ -22,12 +22,12 @@ use jni::JNIEnv; /// HelloWorld::hello method implementation. #[no_mangle] pub extern "system" fn Java_HelloWorld_hello( - env: JNIEnv, + mut env: JNIEnv, _class: JClass, name: JString, ) -> jstring { - let input: String = env.get_string(name).unwrap().into(); + let input: String = env.get_string(&name).unwrap().into(); let greeting = format!("Hello, {input}!"); let output = env.new_string(greeting).unwrap(); - output.into_inner() + output.into_raw() } diff --git a/src/android/logging/src/main.rs b/src/android/logging/src/main.rs index 39953458092..4d1a15968e2 100644 --- a/src/android/logging/src/main.rs +++ b/src/android/logging/src/main.rs @@ -22,7 +22,7 @@ fn main() { logger::init( logger::Config::default() .with_tag_on_device("rust") - .with_min_level(log::Level::Trace), + .with_max_level(log::LevelFilter::Trace), ); debug!("Starting program."); info!("Things are going fine.");