From 2ecaab9f15fd3334a2d3ca90fa31073b3014d3b7 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 15 Oct 2023 01:10:11 +0200 Subject: [PATCH] Upgrade to stable `ndk 0.8` and `ndk-sys 0.5` releases --- android-activity/Cargo.toml | 4 ++-- android-activity/src/native_activity/glue.rs | 2 +- android-activity/src/native_activity/mod.rs | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index d95e1c6..8b8aa9b 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -33,8 +33,8 @@ log = "0.4" jni-sys = "0.3" cesu8 = "1" jni = "0.21" -ndk-sys = "0.5.0-beta.0" -ndk = "0.8.0-beta.0" +ndk-sys = "0.5.0" +ndk = "0.8.0" ndk-context = "0.1" android-properties = "0.2" num_enum = "0.7" diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 679cd13..d7014d1 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -909,7 +909,7 @@ extern "C" fn ANativeActivity_onCreate( // code to look up non-standard Java classes. android_main(app); }) - .unwrap_or_else(|panic| log_panic(panic)); + .unwrap_or_else(log_panic); // Let JVM know that our Activity can be destroyed before detaching from the JVM // diff --git a/android-activity/src/native_activity/mod.rs b/android-activity/src/native_activity/mod.rs index f5c5cc1..7776e3b 100644 --- a/android-activity/src/native_activity/mod.rs +++ b/android-activity/src/native_activity/mod.rs @@ -494,14 +494,13 @@ impl<'a> InputIteratorInner<'a> { return false; }; - // Note: we basically ignore errors from get_event() currently. Looking - // at the source code for Android's InputQueue, the only error that - // can be returned here is 'WOULD_BLOCK', which we want to just treat as - // meaning the queue is empty. + // Note: we basically ignore errors from event() currently. Looking at the source code for + // Android's InputQueue, the only error that can be returned here is 'WOULD_BLOCK', which we + // want to just treat as meaning the queue is empty. // // ref: https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/jni/android_view_InputQueue.cpp // - if let Ok(Some(ndk_event)) = queue.get_event() { + if let Ok(Some(ndk_event)) = queue.event() { log::trace!("queue: got event: {ndk_event:?}"); if let Some(ndk_event) = queue.pre_dispatch(ndk_event) {