Skip to content

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

Merge PR #1625: Launcher: power_on_home_always, Home at every power-on whatever is in front

Gathin23db9dae5c93b0
diff --cc docs/TROUBLESHOOTING.md
index 281993611,0dcfc29fd..9476cc49f
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@@ -690,20 -555,10 +690,24 @@@ Things that bit us or contributors, so
HDMI inputs. Set `power_on_home` (`config.xml` or a theme) with `HOME_KEY_SERVICE=1`: until the first
key press after boot or screen-on, `HomeKeyService` sends that Live TV window back to Home. Ask the
person first; someone who watches broadcast TV may want the opposite, `boot_to_live_tv`.
+- **A third-party screensaver never shows**, seen on a TCL 65C745 (`G05_4K_GB`, Google TV 11, `AR2101`):
+ the TV starts dreaming after the timeout and wakes up in the same millisecond, so nothing appears.
+ `logcat` shows `DreamController: Unable to bind dream service` right after
+ `[TclAppBoot] ... calleeComponent = 'com.neilturner.aerialviews/.ui.screensaver.DreamActivity', bootType =
+ 'bind_service', isAutoStart = 'true', isAllow = 'false', reason = 'callee_does't_have_OP_AUTO_START_permission.'`:
+ the firmware will not start the screensaver app's process to bind it. Allowing the op for that app only
+ and saving it (`tools/tv.py 'appops set <package> APP_AUTO_START allow; appops write-settings'`) fixed it,
+ and it still bound after a reboot. Safety Guard (`com.tcl.guard`, disabled by the TCL lists here) is not
+ the cause: enabling it again changed nothing. The launcher's own Clock screensaver is not affected: Home
+ is already running, so binding `ClockDream` starts nothing (checked on the same TV, with the launcher's
+ `APP_AUTO_START` at `ignore`). To test without waiting for the timeout:
+ `tools/tv.py 'am start -n com.android.systemui/.Somnambulator'`, then
+ `tools/tv.py 'dumpsys dreams | grep mCurrentDreamName'`. The key helpers hit the same denial: see
+ [Accessibility helper enabled but the remote button does nothing](#accessibility-helper-enabled-but-the-remote-button-does-nothing).
+ - **The TV wakes from standby back on the last HDMI input, and `power_on_home` takes about 5 s or misses it**
+ (Philips 65OLED706, Android TV 11): the firmware only resumes the `org.droidtv.playtv` window it left, which
+ sends its window event once the input has a picture, if at all. Set `power_on_home_always` too: Home comes
+ up about a second after the screen turns on, whatever is in front (an input, Live TV or an app).
## Accessibility helper enabled but the remote button does nothing
diff --cc docs/switches.md
index 922a3d988,c77c6a42f..4bd483244
--- a/docs/switches.md
+++ b/docs/switches.md
@@@ -49,7 -49,5 +49,8 @@@ fits the rules; keys from before the ru
| `show_library_pill` | <img src="switches/show_library_pill.jpg" width="320" alt="show_library_pill on a TV"> |
| `library_ok_opens` | <img src="switches/library_ok_opens.jpg" width="320" alt="library_ok_opens on a TV"> |
| `date_below_clock` | <img src="switches/date_below_clock.jpg" width="320" alt="date_below_clock on a TV"> |
+| `locale` | <img src="switches/locale.jpg" width="320" alt="locale set to en on a TV whose system language is Vietnamese"> |
| `power_on_home` | <img src="switches/power_on_home.jpg" width="320" alt="power_on_home on a TV"> |
+| `home_long_press_home` | <img src="switches/home_long_press_home.jpg" width="320" alt="home_long_press_home on a TV"> |
+| `vpn_pill` | <img src="switches/vpn_pill.jpg" width="320" alt="vpn_pill on a TV"> |
+ | `power_on_home_always` | <img src="switches/power_on_home_always.jpg" width="320" alt="power_on_home_always on a TV"> |
diff --cc launcher/app/src/main/java/com/gathin/tvhome/Config.java
index dc5592e60,2c8aa8226..71356ffff
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@@ -168,8 -162,8 +168,10 @@@ final class Config
final String stockHomeRedirect;
/** A Live TV window the firmware opens by itself at power-on is sent back to Home (power_on_home). */
final boolean powerOnHome;
+ /** Every Home press opens this launcher, a held one too, instead of Android's long-press action (home_long_press_home). */
+ final boolean homeLongPressHome;
+ /** Home at every power-on, whatever the firmware put in front: an input, Live TV or an app (power_on_home_always). */
+ final boolean powerOnHomeAlways;
/** The Settings button opens the quick settings panel instead of the TV's Settings (settings_key_panel). */
final boolean settingsKeyPanel;
/** Home puts the remote's accessibility helpers back after a force stop (restore_key_services; ServiceRepair). */
@@@ -268,7 -262,7 +270,7 @@@
List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, boolean appGlow, boolean fadeRows, int homeIdleClockMinutes,
boolean keyFilter, boolean dockGlass, String glowStyle, boolean wallpaperCaptions,
boolean handleViewInputs, boolean tileMenu, boolean dockEvenPadding, boolean dockBand, boolean cinematicDots, boolean cinematicWhiteFocus, boolean wifiStatusColor, int cinematicScrim, int cinematicArt,
- Map<String, Set<String>> wallpaperMoods, boolean gamepadPassthrough, boolean consumeVolumeKeys, boolean powerOnHome, boolean homeLongPressHome, boolean wifiStatusWarnings, List<String> topBarApps, boolean showGreeting, boolean headerWhite, boolean clockWallpaper, int clockWallpaperDim, boolean clockGlow, String glassStyle, boolean singleRow, boolean dockBandAll, boolean lunarDate, int lunarUtcOffset, boolean dateBelowClock, boolean vpnPill, String locale) {
- Map<String, Set<String>> wallpaperMoods, boolean gamepadPassthrough, boolean consumeVolumeKeys, boolean powerOnHome, boolean wifiStatusWarnings, List<String> topBarApps, boolean showGreeting, boolean headerWhite, boolean clockWallpaper, int clockWallpaperDim, boolean clockGlow, String glassStyle, boolean singleRow, boolean dockBandAll, boolean lunarDate, int lunarUtcOffset, boolean dateBelowClock, boolean powerOnHomeAlways) {
++ Map<String, Set<String>> wallpaperMoods, boolean gamepadPassthrough, boolean consumeVolumeKeys, boolean powerOnHome, boolean homeLongPressHome, boolean wifiStatusWarnings, List<String> topBarApps, boolean showGreeting, boolean headerWhite, boolean clockWallpaper, int clockWallpaperDim, boolean clockGlow, String glassStyle, boolean singleRow, boolean dockBandAll, boolean lunarDate, int lunarUtcOffset, boolean dateBelowClock, boolean vpnPill, String locale, boolean powerOnHomeAlways) {
this.handleViewInputs = handleViewInputs;
this.tileMenu = tileMenu;
this.inputKeycodes = inputKeycodes;
@@@ -361,7 -352,7 +363,8 @@@
this.gamepadPassthrough = gamepadPassthrough;
this.consumeVolumeKeys = consumeVolumeKeys;
this.powerOnHome = powerOnHome;
+ this.homeLongPressHome = homeLongPressHome;
+ this.powerOnHomeAlways = powerOnHomeAlways;
this.wifiStatusWarnings = wifiStatusWarnings;
this.topBarApps = Collections.unmodifiableList(topBarApps);
this.showGreeting = showGreeting;
@@@ -467,7 -457,7 +470,8 @@@
boolean gamepadPassthrough = res.getBoolean(R.bool.gamepad_passthrough);
boolean consumeVolumeKeys = res.getBoolean(R.bool.consume_volume_keys);
boolean powerOnHome = res.getBoolean(R.bool.power_on_home);
+ boolean homeLongPressHome = res.getBoolean(R.bool.home_long_press_home);
+ boolean powerOnHomeAlways = res.getBoolean(R.bool.power_on_home_always);
boolean dockGlass = res.getBoolean(R.bool.dock_glass);
boolean dockEvenPadding = res.getBoolean(R.bool.dock_even_padding);
boolean dockBand = res.getBoolean(R.bool.dock_band);
@@@ -570,7 -557,7 +574,8 @@@
gamepadPassthrough = bool(json, "gamepad_passthrough", gamepadPassthrough);
consumeVolumeKeys = bool(json, "consume_volume_keys", consumeVolumeKeys);
powerOnHome = bool(json, "power_on_home", powerOnHome);
+ homeLongPressHome = bool(json, "home_long_press_home", homeLongPressHome);
+ powerOnHomeAlways = bool(json, "power_on_home_always", powerOnHomeAlways);
dockGlass = bool(json, "dock_glass", dockGlass);
dockEvenPadding = bool(json, "dock_even_padding", dockEvenPadding);
dockBand = bool(json, "dock_band", dockBand);
@@@ -653,9 -638,9 +658,9 @@@
json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow, appGlow, fadeRows,
Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions, handleViewInputs, tileMenu, dockEvenPadding,
dockBand, cinematicDots, cinematicWhiteFocus, wifiStatusColor, cinematicScrim, cinematicArt, wallpaperMoods, gamepadPassthrough,
- consumeVolumeKeys, powerOnHome, wifiStatusWarnings, topBarApps, showGreeting, headerWhite, clockWallpaper,
+ consumeVolumeKeys, powerOnHome, homeLongPressHome, wifiStatusWarnings, topBarApps, showGreeting, headerWhite, clockWallpaper,
Math.max(0, Math.min(90, clockWallpaperDim)), clockGlow, glassStyle, singleRow && dockRow, dockBandAll, lunar, lunarOffset,
- dateBelowClock, vpnPill, locale);
- dateBelowClock, powerOnHomeAlways);
++ dateBelowClock, vpnPill, locale, powerOnHomeAlways);
}
/**
diff --cc launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java
index f62abd46f,4f2b0d932..48bcf21be
--- a/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java
@@@ -38,10 -38,9 +38,12 @@@ import java.util.Set
*
* With power_on_home set, a Live TV window (live_tv_package) that the firmware opens by itself at power-on is sent
* back here too, until the first key press after boot or after the screen turns on (Changhong / Homwee boards).
+ * With power_on_home_always set, Home comes up at every power-on whatever is in front, for TVs that resume their
+ * last source: a Philips back on an HDMI input sends no window event until the input has a picture.
*
+ * With home_long_press_home set, it takes every Home press, so one held past the long-press timeout opens this launcher
+ * instead of Android's ALL_APPS action, which nothing answers once the stock launcher is disabled (Philips TPM191E).
+ *
* Enable over adb:
* settings put secure enabled_accessibility_services com.gathin.tvhome/.HomeKeyService
* settings put secure accessibility_enabled 1
@@@ -71,8 -70,8 +73,10 @@@ public class HomeKeyService extends Acc
/** power_on_home: the Live TV package to send back to Home, empty when off; armed until this uptime or a key. */
private String powerOnLiveTv = "";
private long powerOnUntil;
+ /** home_long_press_home: this service takes every Home press, held ones included. */
+ private boolean homeLongPressHome;
+ /** power_on_home_always: Home at every power-on, not only over Live TV. */
+ private boolean powerOnAlways;
/** power_on_home: re-arms after the screen turns on; null unless the key is on. */
private BroadcastReceiver screenOnReceiver;
/** Stops key filtering while a game controller is connected; null unless gamepad_passthrough and key_filter, or before the unlock. */
diff --cc launcher/app/src/main/res/values/config.xml
index 643132a0b,e06ef55e8..e3b96ef37
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@@ -207,16 -205,11 +207,20 @@@
to the user, so opening Live TV on purpose is never undone. The opposite of boot_to_live_tv, and ignored
when that is on. A theme's config.json can set it too. Off by default. -->
<bool name="power_on_home">false</bool>
+ <!-- Home at every power-on, whatever the firmware put in front (the last HDMI input, Live TV or an app),
+ for TVs that come back to the last source, like Philips. Needs HOME_KEY_SERVICE=1; a key pressed first
+ wins. Ignored with boot_to_live_tv or an Open on start app. Can also be set with "power_on_home_always". -->
+ <bool name="power_on_home_always">false</bool>
+ <!-- Every press of the remote's Home button opens this launcher, a held one too. Android turns a Home press held
+ past the long-press timeout (400 ms) into its long-press action; on Android TV that is ALL_APPS, sent to the
+ system-image launcher, and with the stock launcher disabled nothing answers it, so a firm press on a slow
+ remote does nothing (Philips TPM191E, Android 12). The long_press_timeout setting does not move that limit
+ there. HomeKeyService (HOME_KEY_SERVICE=1) then takes the Home key itself and opens Home on release. Needs
+ key_filter, so held keys such as Volume Up/Down stop repeating (confirmed on that Philips; single presses
+ still step). A theme's config.json can set it too. Off by default. -->
+ <bool name="home_long_press_home">false</bool>
+
<!-- Show the Solar Hijri (Shamsi) date used in Iran and Afghanistan, e.g. "27 Mehr 1405", above the
Gregorian date. -->
<bool name="shamsi_date">false</bool>
diff --cc themes/README.md
index 2c3b7ae92,ad99becca..ca3c1027b
--- a/themes/README.md
+++ b/themes/README.md
@@@ -124,7 -122,7 +124,8 @@@ A new key needs one there in the same p
| `consume_volume_keys` | bool | `true` makes the key helpers swallow Volume Up/Down and repeat a held one themselves (after 500 ms, every 60 ms). Use it on firmware that applies a volume key both before the helper and when the helper hands it back, so one tap moves two steps (TCL G03 / BeyondTV4, Android 11, #1100). Needs `key_filter` on. Off by default |
| `stock_home_redirect` | string | Stock launcher package; if the firmware turns it back on (XGIMI), its home screen is sent straight back here (`HOME_KEY_SERVICE=1`) |
| `power_on_home` | bool | For firmware that opens the Live TV app (`live_tv_package`) by itself at every power-on (Changhong / Homwee): until the first key press after boot or screen-on, that Live TV window is sent back to Home (`HOME_KEY_SERVICE=1`). Ignored with `boot_to_live_tv`, or with Live TV as the Open on start app. Off by default |
+| `home_long_press_home` | bool | Every Home press opens Home, a held one too. Android turns a Home press held past 400 ms into ALL_APPS for the system-image launcher, which nothing answers once the stock launcher is disabled, so a firm press on a slow remote did nothing (Philips TPM191E, Android 12, where `long_press_timeout` does not move that limit). Needs `key_filter` (`HOME_KEY_SERVICE=1`), so held keys such as Volume Up/Down stop repeating, confirmed on that Philips; single presses still step. Off by default |
+ | `power_on_home_always` | bool | Home at every power-on, whatever the TV put in front: the last HDMI input, Live TV or an app, for TVs that come back to the last source (Philips). Unlike `power_on_home`, it does not wait for a window to show: the Home screen comes up about a second after the screen turns on (`HOME_KEY_SERVICE=1`). A key pressed before that wins. Ignored with `boot_to_live_tv`, or with an Open on start app. Off by default |
| `race_calendar` | list of races | F1 race-weekend mode: from 12 hours before a weekend's first session until 4 hours after the race starts, a panel under the clock shows the next session with a countdown (or the live one) and the weekend's session times in the TV's time zone. Write it with `tools/race_calendar.py <theme folder>`, which fetches the season from the free Jolpica API; the launcher itself never goes online |
| `home_idle_clock_minutes` | 0 to 1440 | Minutes Home may sit untouched before it shows the clock screensaver (a thin clock and date drifting over a slow glow, as the system "Clock" screensaver does). Any key returns to Home. It starts only from Home, never over Live TV or an app; 0 is off (default) |
| `clock_wallpaper` | bool | The clock screensaver over Home's wallpaper instead of black with a coloured glow; the clock still moves every minute (`false` by default) |