Skip to content

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

Merge PR #186: diagnose enabled but unbound accessibility services

Gathin23643cc2ee7e53
diff --cc PROMPT.md
index d674fea6a,75b2e0389..9faec58c9
--- a/PROMPT.md
+++ b/PROMPT.md
@@@ -87,6 -87,9 +87,9 @@@ Launche
Verify
- After each change, inject remote key presses over ADB, take a screenshot from the TV and look at it.
Fix what you see before moving on.
-- If using an accessibility helper for a remote button, check both its enabled setting and live
- binding for the current Android user, then ask me to press the physical button; an injected HOME
- key is not proof that the helper works (see `docs/TROUBLESHOOTING.md`, accessibility helpers).
++- If a remote button relies on an accessibility helper, check that the service is enabled and bound
++ for the current user, then ask me to press the real button; an injected key is not proof (see
++ `docs/TROUBLESHOOTING.md`).
- When done, give me a restore script, a build-and-install script, and a README that explains how to
re-enable any app and how to change the dock order or the wallpaper.
diff --cc docs/TROUBLESHOOTING.md
index ff7c0f36a,1b79bf1b4..3c11674d7
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@@ -85,3 -85,50 +85,33 @@@ Things that bit us or contributors, so
package that also claims HOME (PatchWall on Xiaomi) makes Android drop the default. The install
script now picks the known stock launcher among the candidates by itself; otherwise choose one on
the TV or pass `STOCK_LAUNCHER=<package>`.
+
+ ## Accessibility helper enabled but the remote button does nothing
+
-The optional `HomeKeyService` and `InputKeyService` need Android to bind to them before they can
-filter remote keys. The installer's `enabled` message follows settings writes; it does not check
-live binding. Resolving the launcher as HOME is a separate check.
-
-With the intended TV selected through `TV_HOST`, read the current state without changing it:
++The optional `HomeKeyService` and `InputKeyService` only filter remote keys once Android has bound to
++them. The installer's `enabled` message means the setting was written, not that the service is bound.
++Read the state without changing anything:
+
+ ```sh
+ tools/tv.py 'am get-current-user'
-tools/tv.py 'settings --user current get secure accessibility_enabled'
+ tools/tv.py 'settings --user current get secure enabled_accessibility_services'
+ tools/tv.py 'dumpsys accessibility'
+ ```
+
-Use the returned user ID when reading the dump; don't assume user 0. If the user changes during
-these checks, read them again. Check only the helper you opted into:
-
-| Helper | Component in the enabled-services list | Key code it filters |
++| Helper | Component in the enabled-services list | Key it filters |
+ | --- | --- | --- |
-| Home button | `com.gathin.tvhome/.HomeKeyService` | `KEYCODE_ALL_APPS`, not ordinary `KEYCODE_HOME` |
++| Home button | `com.gathin.tvhome/.HomeKeyService` | `KEYCODE_ALL_APPS` (not an ordinary `KEYCODE_HOME`) |
+ | Input button | `com.gathin.tvhome/.InputKeyService` | `KEYCODE_TV` |
+
-The class may also be written in full, for example
-`com.gathin.tvhome/com.gathin.tvhome.HomeKeyService`. Match the whole component, not just a class
-name substring. `accessibility_enabled=1` alone may mean that another app's service is enabled.
-
-- **Enabled configuration:** the requested component is in that user's colon-separated
- `enabled_accessibility_services` list and accessibility is enabled. This records the request,
- not a running service.
-- **Live binding:** inspect that same user's `Bound services` section (`services` on older Android
- builds). An entry under `Enabled services` or `Binding services` is not proof of a completed
- binding. Allow a few seconds after enabling, then read the dump again. Some dumps show service
- labels rather than components; labels can be translated or shared with other services. A match
- for the word `Home` is not enough to identify our helper. If the format or identity is unclear,
- treat binding as unknown rather than declaring success or failure.
-- **Remote behavior:** ask the person at the TV to press the relevant physical button from another
- app. Injected HOME and a launcher screenshot can confirm navigation, but do not prove that the
- remote sends the key this helper filters, or that the accessibility filter received it.
++- **Enabled** means the component is in that user's colon-separated list (the class may be written in
++ full, `com.gathin.tvhome/com.gathin.tvhome.HomeKeyService`). Match the whole component.
++- **Bound** means it appears under that user's `Bound services` section of the dump (`services` on older
++ builds). Give it a few seconds after enabling and read again. Labels in the dump can be translated or
++ shared with other services; a line containing "Home" is not proof.
++- **Working** means the physical button does the right thing from inside another app. An injected key
++ over ADB proves navigation, not that the remote sends the code this helper filters.
+
-If the component is enabled but clearly absent from the bound services, inspect local logs for a
-binding failure, crash or firmware startup restriction before changing settings. One firmware
-observation is in the [TCL G08 notes](../examples/tcl-qm6k-google-tv/debloat.txt). Do not overwrite
-the enabled-services list, grant app-ops on every TV, or disable more packages as a generic fix.
-When reporting a failure, include the model, build, current user and only the relevant redacted
-settings/dump/log excerpts; keep raw device logs private.
++Enabled but never bound points at a firmware restriction on auto-starting sideloaded services (some TCL
++builds log `OP_AUTO_START` denials). Look at `logcat` for the binding failure before changing settings,
++and do not rewrite the enabled-services list or grant app-ops as a blanket fix. When reporting, give the
++model, build, current user and the relevant redacted lines, not the raw dump.