Skip to content

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

Merge PR #700: docs: on a TCL C728 the main log is under a minute long, and a long press can't be injected

Gathin2382cafa951d76
diff --cc CONTRIBUTING.md
index 26471ce7c,3e85e024a..85857d00d
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@@ -41,25 -41,11 +41,29 @@@ DynamicAnimation, no Kotlin, no Compose
then hold it for a second:
`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`).
+ SELinux can refuse it even then: on a TCL 55C728 (Google TV 11, enforcing) the shell is in `input`,
+ yet `sendevent` fails with `Permission denied` and `logcat` shows
+ `avc: denied { write } ... scontext=u:r:shell:s0 tcontext=u:object_r:input_device:s0`, while
+ `--longpress` arrives as a short press too. On a set like that, test long presses with the remote.
+### 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