Skip to content

Fire OS: the launcher runs on top of Amazon's Home with stock_home_redirect - #3276

Open
Achar0 wants to merge 1 commit into
Gathin23:mainfrom
Achar0:fire-os-kept-home
Open

Achar0 wants to merge 1 commit into
Gathin23:mainfrom
Achar0:fire-os-kept-home

Conversation

@Achar0

@Achar0 Achar0 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

On Fire OS, Amazon's launcher can't be disabled and outranks set-home-activity. So with STOCK_LAUNCHER=none, Home never resolves to this launcher, and build-and-install.sh stopped with "Home resolves to …, not to the new launcher" before it enabled HomeKeyService. That is why the Fire OS lists say "debloat only", although stock_home_redirect already works on Fire OS once the service is on.

What changes

  • build-and-install.sh / .ps1: with STOCK_LAUNCHER=none and HOME_KEY_SERVICE=1, a Home that stays on the stock launcher is the intended state, because nothing was disabled. The script says "Home stays …; HomeKeyService sends it here (stock_home_redirect)" and carries on. Without HOME_KEY_SERVICE it stops exactly as before.
  • tests/test_launcher_handover.py: two cases on the simulated TV, the kept Home with the redirect (installs, enables HomeKeyService, disables nothing) and without it (still stops).
  • Docs: the AFTKM list's header and tv.json note, the README's Fire TV row, and the stock_home_redirect row in themes/README.md.

Tested on a Fire TV Stick 4K (AFTKM), Fire OS 8.1.8.2. The test build used -PlauncherApplicationId so it sat next to another launcher; the script was otherwise unchanged.

  • The script ran end to end with STOCK_LAUNCHER=none HOME_KEY_SERVICE=1. set-home-activity answered "Success", but Home still resolved to com.amazon.tv.launcher/.ui.HomeActivity_vNext. Unpatched, the script stops at that check.
  • Home from Prime Video: the launcher started 138 / 361 ms after Amazon's home (821 ms on the first press after install). Amazon's home shows until then.
  • Fire OS keeps the Home key itself from accessibility services: a key-logging build saw D-pad and Back, never Home. So on Fire OS the redirect is the window event, and key_filter doesn't matter there.
  • Settings opens MainSettingsActivity directly, so Amazon's home never shows on the way. Wi-Fi opens, and Back from both returns to the launcher.
  • python3 -m unittest discover -s tests: 2864 tests OK (35 skipped, the same as main).

Not done here

  • The other 18 Fire OS lists still say "DEBLOAT ONLY": untested on those models and Fire OS versions.
  • The README translations' Fire TV row (de, nl, pt-BR, tr, uk) still says debloat only.
  • The PowerShell change mirrors the bash one but wasn't run (no Windows here).

Screenshots from the stick: [attached below]

…direct

On Fire OS, Amazon's launcher can't be disabled and outranks set-home-activity, so with
STOCK_LAUNCHER=none Home never resolves to this launcher and build-and-install stopped with
"Home resolves to ..., not to the new launcher" before it enabled HomeKeyService. With
STOCK_LAUNCHER=none and HOME_KEY_SERVICE=1 that state is the intended one (nothing was
disabled, stock_home_redirect sends the stock home here), so the script now says so and
carries on. Same in build-and-install.ps1. Without HOME_KEY_SERVICE it stops as before.

Tested on a Fire TV Stick 4K (AFTKM), Fire OS 8.1.8.2. The AFTKM list's header, its tv.json
note, the README's Fire TV row and the stock_home_redirect row in themes/README.md say how.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

maintainer-bot review · this one needs a maintainer decision

Thanks for the careful AFTKM timings and the two new handover tests, which show the old stop still happens without HomeKeyService. This changes the Home check in the install scripts and changes the project's Fire OS stance from "debloat only", so it needs the maintainer's decision before it goes further.

Why it goes to a maintainer: the bot asks for a maintainer decision.

Checks

This is a suggestion; a maintainer makes the final call. A maintainer can comment /bot review to run it again.

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

@Achar0

Achar0 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author
fire-settings home

@Achar0

Achar0 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Re the #3005 note: they touch different steps. #3005 picks STOCK_LAUNCHER=none + HOME_KEY_SERVICE=1 before an upgrade on a redirect TV; this one lets the Home check after the install accept the stock home in exactly that mode. If Home stays on launcherx after #3005's upgrade, the two together complete the run. The overlap is the handover() helper in the test; happy to rebase whichever lands second.

@Gathin23

Gathin23 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

@Achar0 thank you for the careful AFTKM timings and for the test proving the old stop still happens without HomeKeyService. This touches the install scripts' Home check on the stock_home_redirect route, so it gets a real-TV run of that path on an Android TV before it merges. If you can, a Windows run of the .ps1 change would help, and please rebase if #3005 lands first.

@Achar0

Achar0 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I only have the Fire TV Stick (AFTKM), so I can't do the Android TV run myself — if anyone here has a Google TV / Android TV on the stock_home_redirect route, the check is: STOCK_LAUNCHER=none HOME_KEY_SERVICE=1 TV_HOST=<ip> launcher/build-and-install.sh should end with "Home stays …; HomeKeyService sends it here" and Home should still land on the launcher. I'll do the Windows .ps1 run on the same stick when I'm home, and I'll rebase if #3005 lands first.

@Achar0

Achar0 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Windows run of the .ps1 change, on the same Fire TV Stick 4K (AFTKM, Fire OS 8.1.8.2). Windows 11, Windows PowerShell 5.1.26100.9818, Temurin JDK 17, branch at 9d8765a.

stock_home_redirect set to com.amazon.tv.launcher in config.xml (nothing else changed), on a stick with no com.gathin.tvhome installed:

powershell -ExecutionPolicy Bypass -File launcher\build-and-install.ps1 -TvHost <stick ip> -StockLauncher none -HomeKeyService

It ended with Home stays com.amazon.tv.launcher/.ui.HomeActivity_vNext; HomeKeyService sends it here (stock_home_redirect). and enabled HomeKeyService. Home on the real remote from Prime Video then landed on the launcher, with no visible flash of Amazon's home (logcat shows the launcher started 233 ms after it), and Settings → Back returned to it.

Full output
Downloading https://services.gradle.org/distributions/gradle-8.9-bin.zip
............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%
Stock launcher: none

chunk 1/12
chunk 2/12
chunk 3/12
chunk 4/12
chunk 5/12
chunk 6/12
chunk 7/12
chunk 8/12
chunk 9/12
chunk 10/12
chunk 11/12
chunk 12/12
md5 remote: bb2c2ed9a43702c552ba2554d31aa874 local: bb2c2ed9a43702c552ba2554d31aa874 MATCH
Success
Success
Starting: Intent { cmp=com.gathin.tvhome/.MainActivity }
Status: ok
LaunchState: COLD
Activity: com.gathin.tvhome/.MainActivity
TotalTime: 894
WaitTime: 904
Complete
$ pm grant com.gathin.tvhome android.permission.ACCESS_FINE_LOCATION 2>/dev/null; echo location-granted
location-granted
$ cmd package compile -m speed -f com.gathin.tvhome
Success
$ echo stock launcher left alone
stock launcher left alone
$ cmd package set-home-activity --user 0 com.gathin.tvhome/.MainActivity
Success
Home stays com.amazon.tv.launcher/.ui.HomeActivity_vNext; HomeKeyService sends it here (stock_home_redirect).
$ cmd appops set com.gathin.tvhome AUTO_START allow 2>/dev/null; cmd appops set com.gathin.tvhome APP_AUTO_START allow 2>/dev/null; appops write-settings 2>/dev/null; s=$(settings get secure enabled_accessibility_services); case "$s" in *HomeKeyService*) settings put secure enabled_accessibility_services ""; settings put secure accessibility_enabled 0; sleep 1; settings put secure enabled_accessibility_services "$s" ;; null|"") settings put secure enabled_accessibility_services com.gathin.tvhome/.HomeKeyService ;; *) settings put secure enabled_accessibility_services "$s:com.gathin.tvhome/.HomeKeyService" ;; esac; settings put secure accessibility_enabled 1; echo HomeKeyService enabled
Current settings written.
HomeKeyService enabled
$ pm revoke com.gathin.tvhome android.permission.WRITE_SECURE_SETTINGS; s=$(dumpsys package com.gathin.tvhome) && case "$s" in *"DUMP TIMEOUT"*) ;; *"android.permission.WRITE_SECURE_SETTINGS: granted=true"*) ;; *"android.permission.WRITE_SECURE_SETTINGS"*) echo secure-settings-revoked ;; esac
secure-settings-revoked
Installed. Press Home on the remote to see it.

@Gathin23

Gathin23 commented Nov 6, 2026

Copy link
Copy Markdown
Owner

@Achar0 thank you for the Windows .ps1 run on the stick: that closes the last open item on your side, and the Fire OS timings are excellent. Since this touches the install scripts' Home check on the stock_home_redirect route, it gets one run on an Android TV before it merges. If #3005 or #2954 lands first, please rebase; the README row alone needs no rebase.

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.

2 participants