From 3623169fd7f8cb67bd6dfaaa0f7c9ee30f552a5a Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 29 Jul 2024 10:11:46 +0200 Subject: [PATCH] native_activity: Fix clippy lints around `NativeActivityGlue` not `SendSync` and unwritted `redraw_needed` field --- android-activity/src/native_activity/glue.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 2e4371c..1d3f3b7 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -75,18 +75,20 @@ pub enum State { #[derive(Debug)] pub struct WaitableNativeActivityState { + // TODO: Unnecessary NIHism: why not use ndk::NativeActivity? pub activity: *mut ndk_sys::ANativeActivity, pub mutex: Mutex, pub cond: Condvar, } +unsafe impl Send for WaitableNativeActivityState {} +unsafe impl Sync for WaitableNativeActivityState {} + #[derive(Debug, Clone)] pub struct NativeActivityGlue { pub inner: Arc, } -unsafe impl Send for NativeActivityGlue {} -unsafe impl Sync for NativeActivityGlue {} impl Deref for NativeActivityGlue { type Target = WaitableNativeActivityState; @@ -223,7 +225,6 @@ pub struct NativeActivityState { /// Set as soon as the Java main thread notifies us of an /// `onDestroyed` callback. pub destroyed: bool, - pub redraw_needed: bool, pub pending_input_queue: *mut ndk_sys::AInputQueue, pub pending_window: Option, } @@ -370,7 +371,6 @@ impl WaitableNativeActivityState { thread_state: NativeThreadState::Init, app_has_saved_state: false, destroyed: false, - redraw_needed: false, pending_input_queue: ptr::null_mut(), pending_window: None, }),