Slint's android-activity backend wakes the main loop from a dedicated "slint vsync" Choreographer thread while any animation is active (i-slint-backend-android-activity/vsync.rs). Android schedules that thread at nice +10 (lowest on device), while our 4 turbojpeg workers inherited the UI thread's nice -10. Under CPU bursts the +10 waker starves and the main loop's next wakeup lands 3-4 frames late: 25-33 ms of pure wake latency at 120 Hz, with zero cost in our tick (d=7-34 us) — exactly the phone stall signature (measured: 28-39 ms gaps, catch-up events). - prio module: setpriority FFI (self + by-tid), raise_slint_vsync() - thumb workers + dispatcher: nice +2 at spawn (ahead of background apps, behind the UI's -10) - android_main: prio-fix thread raises "slint vsync" to nice 0 with a readback log - verified on emulator: thumb-* hold nice 2, slint vsync holds 0 while foreground (Android re-nices backgrounded processes — expected) - emulator scroll cadence unchanged (llvmpipe rasterization ceiling, not a priority issue) — phone is the acceptance target, A/B test planned for when it is back online Also: drop unused android_logger dependency (nblog replaced it).
64 lines
2.0 KiB
TOML
64 lines
2.0 KiB
TOML
[package]
|
|
name = "gallery"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "lib"]
|
|
|
|
[dependencies]
|
|
slint = { version = "1.18.1", features = ["backend-android-activity-06"] }
|
|
log = "0.4"
|
|
rusqlite = { version = "0.41.0", features = ["bundled"] }
|
|
sha1 = "0.11.0"
|
|
turbojpeg = { version = "1.5.1", features = ["cmake"] }
|
|
image = { version = "0.25.10", default-features = false, features = ["png"] }
|
|
kamadak-exif = "0.6.1"
|
|
|
|
[build-dependencies]
|
|
slint-build = "1.18.1"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3.27.0"
|
|
|
|
# --- Android packaging (cargo-apk2 1.5) ---
|
|
# NOTE: uses_permission is a TOP-LEVEL android key (ndk-build2 manifest layer),
|
|
# not under [package.metadata.android.application]. max_sdk_version supported.
|
|
[package.metadata.android]
|
|
package = "wow.gmp.gallery"
|
|
build_targets = ["x86_64-linux-android", "aarch64-linux-android"]
|
|
|
|
[package.metadata.android.sdk]
|
|
min_sdk_version = 26
|
|
target_sdk_version = 35
|
|
|
|
[package.metadata.android.application]
|
|
label = "Gallery"
|
|
|
|
[[package.metadata.android.application.activity]]
|
|
name = "android.app.NativeActivity"
|
|
|
|
[[package.metadata.android.application.activity.meta_data]]
|
|
name = "android.app.lib_name"
|
|
value = "gallery"
|
|
|
|
[[package.metadata.android.application.activity.intent_filter]]
|
|
actions = ["android.intent.action.MAIN"]
|
|
categories = ["android.intent.category.LAUNCHER"]
|
|
|
|
# --- Permissions (runtime flow: HANDOFF.md §7) ---
|
|
# NOTE: the Permission schema supports only `name` + `max_sdk_version`.
|
|
# READ_MEDIA_IMAGES is a no-op on API < 33 (unknown perms are ignored).
|
|
[[package.metadata.android.uses_permission]]
|
|
name = "android.permission.READ_MEDIA_IMAGES"
|
|
|
|
# API <= 32: legacy external storage read.
|
|
[[package.metadata.android.uses_permission]]
|
|
name = "android.permission.READ_EXTERNAL_STORAGE"
|
|
max_sdk_version = 32
|
|
|
|
# "All files access" — same special-access pattern as passgo; needed to browse
|
|
# arbitrary directories outside the media collection.
|
|
[[package.metadata.android.uses_permission]]
|
|
name = "android.permission.MANAGE_EXTERNAL_STORAGE"
|