Clean up partial module imports

Some items were imported in scope while most of the code uses fully
qualified names.
This commit is contained in:
Marijn Suijten
2023-04-01 15:11:48 +02:00
parent 0c3f16c9ba
commit fe9d68c99e
2 changed files with 8 additions and 14 deletions
+3 -4
View File
@@ -14,7 +14,6 @@ use std::{
use log::Level;
use ndk::{configuration::Configuration, input_queue::InputQueue, native_window::NativeWindow};
use ndk_sys::ANativeActivity;
use crate::ConfigurationRef;
@@ -99,7 +98,7 @@ impl Deref for NativeActivityGlue {
impl NativeActivityGlue {
pub fn new(
activity: *mut ANativeActivity,
activity: *mut ndk_sys::ANativeActivity,
saved_state: *const libc::c_void,
saved_state_size: libc::size_t,
) -> Self {
@@ -149,7 +148,7 @@ impl NativeActivityGlue {
self.inner.mutex.lock().unwrap().read_cmd()
}
/// For the Rust main thread to get an ndk::InputQueue that wraps the AInputQueue pointer
/// For the Rust main thread to get an [`InputQueue`] that wraps the AInputQueue pointer
/// we have and at the same time ensure that the input queue is attached to the given looper.
///
/// NB: it's expected that the input queue is detached as soon as we know there is new
@@ -837,7 +836,7 @@ extern "C" fn ANativeActivity_onCreate(
// Note: we drop the thread handle which will detach the thread
std::thread::spawn(move || {
let activity: *mut ANativeActivity = activity_ptr as *mut _;
let activity: *mut ndk_sys::ANativeActivity = activity_ptr as *mut _;
let jvm = unsafe {
let na = activity;
+5 -10
View File
@@ -7,12 +7,7 @@ use std::time::Duration;
use libc::c_void;
use log::{error, trace};
use ndk_sys::ALooper_wake;
use ndk_sys::{ALooper, ALooper_pollAll};
use ndk::asset::AssetManager;
use ndk::native_window::NativeWindow;
use ndk::{asset::AssetManager, native_window::NativeWindow};
use crate::{
util, AndroidApp, ConfigurationRef, InputStatus, MainEvent, PollEvent, Rect, WindowManagerFlags,
@@ -63,7 +58,7 @@ pub struct AndroidAppWaker {
// The looper pointer is owned by the android_app and effectively
// has a 'static lifetime, and the ALooper_wake C API is thread
// safe, so this can be cloned safely and is send + sync safe
looper: NonNull<ALooper>,
looper: NonNull<ndk_sys::ALooper>,
}
unsafe impl Send for AndroidAppWaker {}
unsafe impl Sync for AndroidAppWaker {}
@@ -77,7 +72,7 @@ impl AndroidAppWaker {
/// [wake_event]: crate::PollEvent::Wake
pub fn wake(&self) {
unsafe {
ALooper_wake(self.looper.as_ptr());
ndk_sys::ALooper_wake(self.looper.as_ptr());
}
}
}
@@ -119,7 +114,7 @@ impl AndroidApp {
#[derive(Debug)]
struct Looper {
pub ptr: *mut ALooper,
pub ptr: *mut ndk_sys::ALooper,
}
unsafe impl Send for Looper {}
unsafe impl Sync for Looper {}
@@ -174,7 +169,7 @@ impl AndroidAppInner {
!ndk_sys::ALooper_forThread().is_null(),
"Application tried to poll events from non-main thread"
);
let id = ALooper_pollAll(
let id = ndk_sys::ALooper_pollAll(
timeout_milliseconds,
&mut fd,
&mut events,