Skip to content

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

Merge PR #496: launcher: boot_to_live_tv, open Live TV on the first Home after boot

Gathin23ec791eafee32
diff --cc launcher/app/src/main/java/com/gathin/tvhome/Config.java
index 16e245905,93cad5742..752dc44b3
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@@ -138,27 -106,19 +140,27 @@@ final class Config
final List<RaceWeekend.Race> raceCalendar;
/** Cinematic top shelf (config.xml, cinematic_home): the focused dock app's artwork behind a larger shelf. */
final boolean cinematicHome;
+ /** The glow in the focused app's colour behind the dock (config.xml, ambient_glow); false keeps the background plain. */
+ final boolean ambientGlow;
+ /** Minutes Home may sit untouched before the clock screensaver (config.xml, home_idle_clock_minutes); 0 is off. */
+ final int homeIdleClockMinutes;
private Config(List<String> dockApps, boolean fillDock, List<String> hiddenApps, String liveTvPackage,
- String liveTvAction, Map<String, String> launchActions, Map<String, String> appLabels,
- Map<String, String> appBanners, String sourcePanelService, String sourcePanelAction, String inputAction,
- int columns, int rowsBelowDock, boolean animations, boolean advancedEffects,
- boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean bootToLiveTv, boolean dockTitle, boolean dockRow, boolean reorderButton, String vpnApp,
+ String liveTvAction, String liveTvInputId, Map<String, String> launchActions, Map<String, String> appLabels,
+ Map<String, String> appBanners, String sourcePanelService, String sourcePanelAction,
+ String sourcePanelExtra, boolean coocaaSources, String inputAction,
+ String inputUriScheme, int columns, int rowsBelowDock, boolean animations, boolean advancedEffects,
- boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean dockTitle, boolean dockRow, boolean reorderButton, boolean showNetworkPill, boolean showInputsPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, String vpnApp,
++ boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean bootToLiveTv, boolean dockTitle, boolean dockRow, boolean reorderButton, boolean showNetworkPill, boolean showInputsPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, String vpnApp,
boolean showHomeSettingsShortcut, boolean showStats, boolean appLibrary, int backgroundColor, int skyIntensity,
int[] settingsKeycodes, boolean settingsKeyPanel, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,
- int wallpaperRotationMinutes, int wallpaperDim, boolean overlayApplied,
- Festival festival, int[] inputKeycodes, List<String> appKeys,
- List<RaceWeekend.Race> raceCalendar, boolean cinematicHome) {
+ int wallpaperRotationMinutes, int wallpaperDim, String wallpaperOrder, boolean overlayApplied,
+ Festival festival, int[] inputKeycodes, List<String> appKeys, String stockHomeRedirect,
+ List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes,
+ boolean keyFilter) {
this.inputKeycodes = inputKeycodes;
this.appKeys = Collections.unmodifiableList(appKeys);
+ this.keyFilter = keyFilter;
+ this.stockHomeRedirect = stockHomeRedirect;
this.dockApps = Collections.unmodifiableList(dockApps);
this.fillDock = fillDock;
this.hiddenApps = Collections.unmodifiableList(hiddenApps);
@@@ -376,15 -289,14 +381,15 @@@
Festival festival = json == null ? Festival.NONE : Festival.parse(string(json, "festival", ""),
string(json, "festival_until", ""), string(json, "greeting", ""), string(json, "accent_color", ""));
- return new Config(dock, fillDock, hidden, liveTv, liveTvAction, packageMap(launchActions), packageMap(appLabels),
+ return new Config(dock, fillDock, hidden, liveTv, liveTvAction, liveTvInputId, packageMap(launchActions), packageMap(appLabels),
packageMap(appBanners), panelService,
- panelAction, inputAction,
+ panelAction, panelExtra, coocaaSources, inputAction, inputUriScheme,
Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,
- shamsi, greetingName, moduleCards, reducedMotion, dockTitle, dockRow, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, vpn, homeSettings, showStats, library, background,
- shamsi, greetingName, moduleCards, reducedMotion, bootToLiveTv, dockTitle, dockRow, reorderButton, vpn, homeSettings, showStats, library, background,
++ shamsi, greetingName, moduleCards, reducedMotion, bootToLiveTv, dockTitle, dockRow, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, vpn, homeSettings, showStats, library, background,
Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, wallpaperEnabled, wallpaper,
- wallpapers, rotationMinutes, wallpaperDim, applied,
- festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic);
+ wallpapers, rotationMinutes, wallpaperDim, wallpaperOrder, applied,
+ festival, inputKeycodes, appKeys, stockHomeRedirect, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow,
+ Math.max(0, idleClockMinutes), keyFilter);
}
/**
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 481e0847c,73f84caf7..1e9359411
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -9,10 -9,9 +9,11 @@@ import android.content.BroadcastReceive
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+ import android.content.SharedPreferences;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
+import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@@@ -331,15 -288,11 +334,16 @@@ public class MainActivity extends Activ
festival = cfg.festival;
festive = festival.active(LocalDate.now());
liveTvPkg = cfg.liveTvPackage;
+ idleClockMs = cfg.homeIdleClockMinutes * MINUTE_MS;
+ bootToLiveTv = cfg.bootToLiveTv;
liveTvAction = cfg.liveTvAction;
+ liveTvInputId = cfg.liveTvInputId;
inputAction = cfg.inputAction;
+ inputUriScheme = cfg.inputUriScheme;
sourcePanelService = cfg.sourcePanelService;
sourcePanelAction = cfg.sourcePanelAction;
+ sourcePanelExtra = cfg.sourcePanelExtra;
+ coocaaSources = cfg.coocaaSources;
root = findViewById(R.id.root);
root.setBackgroundColor(cfg.backgroundColor);
@@@ -674,19 -593,11 +678,20 @@@
reloadApps(true);
}
rebuildOnResume = false;
+ if (openLiveTvAfterBoot()) return;
updateGreeting();
updateRace();
- updateWifiLabel();
- updateInputsButton();
+ // The network and Inputs pills keep their state while Home is in the background, and callbacks update them
+ // when the network or the inputs change, so this refresh only catches anything missed. Its binder calls
+ // (about 7 ms on a TCL C755, most of it WifiManager.getConnectionInfo) would hold up the first frame back
+ // on Home, so after the first resume it runs once that frame is drawn.
+ if (pillsShown) {
+ refreshPillsAfterNextDraw();
+ } else {
+ updateWifiLabel();
+ updateInputsButton();
+ pillsShown = true;
+ }
if (showStats) startStats();
sky.update();
wallpaperPlayer.start();
diff --cc themes/README.md
index 25333a93a,332edb30e..ca5980116
--- a/themes/README.md
+++ b/themes/README.md
@@@ -60,7 -44,8 +60,9 @@@ is ignored, and a file that doesn't par
| `shamsi_date` | bool | Show the Solar Hijri date above the Gregorian one |
| `greeting_name` | string | A name after the greeting, e.g. `"Mr. Trịnh"` for GOOD MORNING, MR. TRỊNH; empty for the greeting alone |
| `module_cards` | bool | Look for module cards and ask about them (`true`); `false` turns the feature off |
+| `reduced_motion` | bool | Calmer motion for weak GPUs: highlight settles in 5 frames, animations 90 ms or less, no fades, no tile entrance |
+ | `reduced_motion` | bool | Calmer motion for weak GPUs: stiff highlight spring, no tile overshoot, short fades, no entrance replay |
+ | `boot_to_live_tv` | bool | Open the Live TV app (`live_tv_package`) on the first Home after the TV starts, once per boot |
| `vpn_app` | string | App the network pill opens when a VPN is configured; also shows a red "VPN off" badge while no VPN is up |
| `animations` | bool | Basic focus, glass, title and tile entrance motion; true by default |
| `advanced_effects` | bool | Optional lifted tile, icon zoom, smooth ambient colour and app opening effects; false by default |