Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

docs: clarify automated D-pad and lifecycle checks

SaviorOneZeroe2027bfe85d7
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e6e74fe45..26471ce7c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -42,6 +42,24 @@ DynamicAnimation, no Kotlin, no Compose, no network. It targets TVs with 1 GB of
`tools/tv.py 'e=/dev/input/event1; sendevent $e 1 352 1; sendevent $e 0 0 0; sleep 1.2; sendevent $e 1 352 0; sendevent $e 0 0 0'`.
This needs the shell user in the `input` group (`tools/tv.py id`).
+### Automated navigation and lifecycle checks
+
+- Use D-pad key events throughout focus tests, including entering and leaving Reorder.
+ Injected touch input can enter Android's system-wide [touch mode](https://developer.android.com/develop/ui/views/touch-and-input/input-events#TouchMode),
+ where ordinary buttons may not take focus. If a test uses touch, send a directional key
+ and verify the focused tile before continuing with D-pad assertions.
+- After Home, an app transition or a reboot, wait with a timeout for the launcher UI and
+ focused window before sending navigation or capturing a hierarchy. A fixed sleep or
+ a boot-completion property alone does not establish that Home is ready. Android's
+ [UI Automator guidance](https://developer.android.com/training/testing/other-components/ui-automator-legacy#wait)
+ demonstrates waiting for the launcher and for specific UI conditions.
+- For synthetic memory checks, record the process state, requested trim level and command
+ result. ActivityManager [can reject background trim levels for foreground processes](https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/am/ActivityManagerService.java).
+ To exercise hidden Home, put an opaque app in front and verify Home's process state;
+ use a trim level supported by the target Android version. Treat a rejected command as
+ a test setup failure. A delivered trim callback tests recovery behavior, not performance
+ under real memory pressure.
+
Build with `TV_HOST=<ip> launcher/build-and-install.sh` (JDK 17, Android SDK platform 34 and
build-tools 34.0.0; on macOS `brew install openjdk@17 android-commandlinetools` then
`sdkmanager "platforms;android-34" "build-tools;34.0.0"`; with the newer command-line tools the form is