From 471d2faeab2bc9aaa14c222c79d2240b5d6450b5 Mon Sep 17 00:00:00 2001 From: Greg Pomerantz Date: Tue, 3 Nov 2026 09:09:34 -0500 Subject: [PATCH] gtauri: zero-delay handling for Android MediaStore content watcher events (immediate push) --- harnesses/gtauri/src/lib.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/harnesses/gtauri/src/lib.rs b/harnesses/gtauri/src/lib.rs index 70aa4a5..f87d707 100644 --- a/harnesses/gtauri/src/lib.rs +++ b/harnesses/gtauri/src/lib.rs @@ -1237,9 +1237,17 @@ fn watch_files(app: tauri::AppHandle) { }; let do_full = matches!(woke, Some(WEvent::Full)); if let Some(WEvent::Fs) = woke { - while rx.try_recv().is_ok() {} - std::thread::sleep(std::time::Duration::from_millis(600)); - while rx.try_recv().is_ok() {} + #[cfg(target_os = "android")] + { + apply_mediasotre_payload(&app); + continue; + } + #[cfg(not(target_os = "android"))] + { + while rx.try_recv().is_ok() {} + std::thread::sleep(std::time::Duration::from_millis(600)); + while rx.try_recv().is_ok() {} + } } if do_full { tr("watch: full rescan (5min)");