Skip to content

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

Launcher: guard lastFocused >= 0 before refreshing the Last opened line

vgscityca5080ef0bc1
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 2a721cc64..c3b2af31b 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -1043,7 +1043,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
updatePanel();
// Back from an app opened from its tile, focus is still on that tile, so the cinematic "Last opened" line kept
// the time from before this launch ("2 days ago" right after opening it). Refresh it.
- if (cinematic && heroMeta != null && lastFocused < adapter.appCount()) updateHeroMeta(lastFocused);
+ if (cinematic && heroMeta != null && lastFocused >= 0 && lastFocused < adapter.appCount()) updateHeroMeta(lastFocused);
// 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