Skip to content

Launcher: InputKeyService binds while the TV is still locked at boot, as HomeKeyService does - #3627

Open
M-khalifa wants to merge 1 commit into
Gathin23:mainfrom
M-khalifa:m-khalifa/launcher-input-key-direct-boot
Open

M-khalifa wants to merge 1 commit into
Gathin23:mainfrom
M-khalifa:m-khalifa/launcher-input-key-direct-boot

Conversation

@M-khalifa

Copy link
Copy Markdown
Contributor

HomeKeyService is directBootAware because, as its own comment says, Android 11 skips a service that is not while the user is still locked at boot, writes accessibility_enabled=0 and, on TCL G03 firmware, never binds it after the unlock. InputKeyService did not have the flag, so a setup with only INPUT_KEY_SERVICE=1 (no HomeKeyService to keep the switch on) is exposed to the same skip. InputKeyService now declares the flag and, like HomeKeyService, waits for ACTION_USER_UNLOCKED before everything that reads credential-protected storage (Config.load, ServiceRepair.connected, the gamepad listener); until then it has no mappings, so keys pass through except the Input button itself. It stays exported="false". Found by reading the code; the reboot case was tried on a TV that does not show the skip (below).

The CVTE bullet in docs/TROUBLESHOOTING.md lists the components that declare the flag; it now names InputKeyService too (tests/test_thomson_40fg2s14w_note.py checks that list against the manifest).

Tested on: TCL Q6 (G10), Google TV 14, build UTT2.250416.001

On the TV, InputKeyService alone on the list (no HomeKeyService), app_keys: ["29:<YouTube>"], reboot: after boot accessibility_enabled is 1, InputKeyService is bound, and the button (the key pressed through a USB keyboard (so it reaches the helpers the way a remote button does; input keyevent does not reach them on this set)) opens YouTube. Only this branch was rebooted (not main), so the run shows the flag and the unlock wait break nothing here; it does not reproduce the G03 skip.

  • gradlew --no-daemon testReleaseUnitTest lintRelease assembleRelease: BUILD SUCCESSFUL, unit tests pass, lint 0 errors (98 warnings, as on main), release APK 587,381 B (main: 587,321 B, +60 B; gate 589,824 B).
  • python -m unittest discover -s tests: 3209 tests, OK (522 skipped: the POSIX-shell and pwsh suites, which CI runs).
  • Python tests that read the manifest or the helpers (test_thomson_40fg2s14w_note, test_helper_table, test_key_filter and others): OK; test_thomson_40fg2s14w_note fails with the new flag until the bullet names the component.
  • No JUnit test: the unlock wait needs UserManager and a bound service, which the plain JVM tests cannot build.

Overlaps #3599, which adds a field and lines at the same places in InputKeyService (field block, top of onServiceConnected, top of onDestroy); whichever merges second needs a small rebase, which I will push.

If this touches the launcher

  • Verified on a real TV (no regression only; the skip itself is not reproduced on this set)
  • D-pad checked from every edge (n/a, no UI change)
  • No network, no background service, no new permission
  • New strings in values/strings.xml and the other values-* folders (n/a, no strings)
  • Anything TV-specific is in config.xml or a theme, not in code

Reviewed with cross-review 1.2.1 (SkillArray, MIT license): https://github.com/M-khalifa/SkillArray

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

maintainer-bot review · this one needs a maintainer decision

Thanks for the PR! Couldn't review this one automatically; it goes to the maintainer.

Checks
  • Launcher: 37 lines changed in launcher/ (tests not counted)
  • OK: no new permission, no network use
  • Note: changes the manifest (other)
  • Size: size/S (+39 -2, 3 files)

Reviewed by maintainer-bot · runs on 0G Private Computer

@github-actions github-actions Bot added launcher Changes under launcher/: the Android TV home screen app needs-maintainer labels Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

launcher Changes under launcher/: the Android TV home screen app needs-maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant