Repository navigation
Audit fixes: trim-level dispatch, torn shared-file reads, cold-start double scan, boot-shield audio - #8
Merged
Conversation
…e scan Correctness & stability: - onTrimMemory treated UI_HIDDEN (20) and every background level (40/60/80) as a CRITICAL trim because they matched 'level >= RUNNING_CRITICAL' (15) first, and the TRIM_MEMORY_COMPLETE branch was unreachable dead code. Opening an app from the launcher used to kill the user's other background apps when aggressive trim was on. - Shared cross-process files (heartbeat, relaunch policy, self-heal) are now written atomically (temp + rename): a plain writeText truncates first, and the :watchdog reading in that window parsed an empty file as 'the launcher is dead' and yanked the screen back to HOME mid-movie. - The boot shield no longer silences audio while a known user app is in front; only boot-ad-like cases (stock launcher / our home / unknown foreground) are silenced. Lightweight: - AppRepository scans are serialised with a Mutex (MainActivity + TvLauncherFragment both scanned on cold start), artwork decoding capped at 6 concurrent ops, and only loaded cache names protect files from pruning. - Heartbeat writes moved off the main thread onto a dedicated daemon thread (rule #3); policy writes too. - DensityAdapter persists uiScale/font-scale prefs only on a real change. - PACKAGE_REMOVED no longer probes PackageManager for the already-gone package; dead MainActivity code (pass-through dispatchKeyEvent, empty setupNavigation) removed. - getInstalledPackages in the accessibility service runs on Dispatchers.IO. Tests: ProcessHeartbeatAtomicWriteTest locks in the atomic-replace write. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…icker with auto-change
Settings UI fixes (colour + remote navigation):
- 27 of 33 buttons hard-coded white text while the focused background is solid white,
so the label vanished exactly when the control got focus ('remote navigation pata
hi nahi chalta'). All buttons now use the color_settings_btn_text state list.
- Chevron icons were replaced with static-colour drawables that killed the
state-aware tint; back/close icons had the same fixed-white bug. Both now flip
dark on the white focus highlight.
- Selected state was identical to focused (both solid white). Selected now draws as
the accent-cyan chip with a dark label.
- SettingsDisplayDelegate force-set text colours in code, overriding the focus
state lists; it now drives selection through isSelected.
- Entering a settings sub-page left D-pad focus on the hidden row (remote looked
dead); every page change now focuses the first control.
Wallpaper picker (user-visible feature):
- The five name-only buttons (labels that no longer matched their gradients) are
replaced by visual tiles rendering the actual gradients, a live preview box, and
a check badge on the committed choice. The custom photo is a tile too.
- Auto-change wallpaper: Off / 15 min / 1 hour / 6 hours / Daily, rotating the
presets via the existing clock loop (WallpaperRotator - no alarms/services; a
custom photo is never auto-replaced; long absence advances one step only).
Tests: WallpaperRotatorTest (6) covers the rotation rule.
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…lock, night light, backup - CI workflow (build debug+release, unit tests, lint) on every push/PR - 10 full themes + 10 accents + wallpaper-palette accent; 10 wallpapers total - Layout modes (banner/compact/large/icon grid), 3-8 columns, app size 60-160% - Focus effects (scale/glow/outline/fill) + focus scale, label show/size - Animation speed, reduced-motion, app-open transitions, perf profiles - Clock styles, date formats, time-of-day greeting, night-light overlay - App sort modes, favourites + recents quick row, long-press app quick menu - Settings backup export/import (JSON via system file picker) - New Settings > Theme & Style page (all controls, D-pad friendly) - Tests: CustomizationConfigTest (7) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…otations Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… formatters Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bugs and lightweight/solid-ness improvements from a full codebase audit. Everything below is behaviour-preserving except where a bug made it not so.
Fixed — correctness & stability
onTrimMemorydispatched nearly every level as a critical trim. The framework levels are three groups, not one monotonic scale:UI_HIDDEN(20) = our UI just went away,BACKGROUND/MODERATE/COMPLETE(40/60/80) = we are backgrounded. The oldlevel >= RUNNING_CRITICAL(15) test caught them all first — so with aggressive trim enabled, simply opening Netflix from the launcher killed the user's other background apps (music included). TheTRIM_MEMORY_COMPLETEbranch was unreachable dead code. Now: 15 = critical, 10 = gentle, 20 = no-op, 40/60/80 = gentle while backgrounded.rename). A plainwriteTexttruncates first — the:watchdogpolling mid-write could read an empty file, parse0, decide "the launcher is dead", and yank the TV back to HOME mid-movie.Mutex, second caller hits the memory cache. Artwork decode/rasterise capped at 6 concurrent ops. Corrupt app-art cache files are no longer protected from pruning.Lightweight / solid
DensityAdapterpersists uiScale/font-scale prefs only on a real change (was on every config emission).PACKAGE_REMOVEDno longer probes PackageManager for the already-gone package; accessibility-service package seed runs onDispatchers.IO.MainActivitycode removed (pass-throughdispatchKeyEvent, emptysetupNavigation()).Tests
ProcessHeartbeatAtomicWriteTest(3) locks in the atomic-replace write.Checklist
tools/ktcheck.pyclean (57 files),tools/check_resources.pyclean (0 broken refs)CHANGELOG.md,docs/PERFORMANCE.md,docs/TESTING.mdupdated./gradlew assembleDebug testDebugUnitTest lintDebug assembleRelease— no JDK/Android SDK in this sandbox; please let CI verify