From c86da1a1ff0391b2a9d2f6d5461b34dee042d883 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Thu, 9 Jul 2026 23:13:36 +0200 Subject: [PATCH] chore(android): silence the two vendored-ndk warnings on every native build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vendored ndk 0.9.0 warned twice per Android build: an unnecessary `std::ptr::` qualification in input_queue.rs (the crate opts into unused_qualifications) and an unused `Result` import in media_format.rs — unused only because its sole consumers are #[cfg(feature = "api-level-29")] methods our default-feature build compiles out, so the import is now gated the same way (both feature configurations stay warning-free). Vendor-patch inventory in the workspace Cargo.toml updated to stay honest. Co-Authored-By: Claude Fable 5 --- Cargo.toml | 3 ++- clients/android/native/vendor/ndk/src/input_queue.rs | 2 +- clients/android/native/vendor/ndk/src/media/media_format.rs | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aa896c26..512362c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,8 @@ exclude = [ "clients/android/native/vendor/ndk", ] -# ndk 0.9.0 verbatim from crates.io plus ONE visibility change: `MediaCodec::as_ptr` made public +# ndk 0.9.0 verbatim from crates.io plus ONE visibility change (and two warning fixes — an +# unnecessary `std::` qualification and a feature-gated `Result` import): `MediaCodec::as_ptr` made public # (upstream keeps it private and exposes no frame-rendered binding), so the Android client can # call `AMediaCodec_setOnFrameRenderedCallback` via ndk-sys for the HUD's `display` stage # (design/stats-unification.md). Drop the patch when upstream exposes the pointer or the callback. diff --git a/clients/android/native/vendor/ndk/src/input_queue.rs b/clients/android/native/vendor/ndk/src/input_queue.rs index 0fae5f11..6c96228d 100644 --- a/clients/android/native/vendor/ndk/src/input_queue.rs +++ b/clients/android/native/vendor/ndk/src/input_queue.rs @@ -130,7 +130,7 @@ impl InputQueue { looper.ptr().as_ptr(), id, None, - std::ptr::null_mut(), + ptr::null_mut(), ) } } diff --git a/clients/android/native/vendor/ndk/src/media/media_format.rs b/clients/android/native/vendor/ndk/src/media/media_format.rs index 4997d522..917faaa6 100644 --- a/clients/android/native/vendor/ndk/src/media/media_format.rs +++ b/clients/android/native/vendor/ndk/src/media/media_format.rs @@ -9,7 +9,11 @@ use std::{ slice, }; -use crate::media_error::{MediaError, Result}; +use crate::media_error::MediaError; +// `Result` is only referenced by the api-level-29 methods below; an ungated import warns +// (unused_imports) on every default-feature build. +#[cfg(feature = "api-level-29")] +use crate::media_error::Result; /// A native [`AMediaFormat *`] ///