Skip to content

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

Merge PR #2434: Launcher: hold OK opens the tile menu reliably with tile_menu on

Gathin236a3f0aef90c4
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 02c1ba4d3,1a3fb4242..ca3f99fa3
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -1231,9 -1213,7 +1231,10 @@@ public class MainActivity extends Activ
protected void onPause() {
super.onPause();
resumed = false;
+ // No UP reaches a paused Home, so a vendor-key hold it saw go down would still open its app later.
+ // Only Home's own share is dropped: a key service that saw the same DOWN keeps its hold.
+ RemoteKeys.release(this);
+ cancelHoldOk();
root.removeCallbacks(showIdleClock);
endReorder(); // Home or another app while reordering keeps the order so far
wallpaperPlayer.stop();
@@@ -1300,7 -1282,7 +1303,8 @@@
@Override
protected void onDestroy() {
super.onDestroy();
+ RemoteKeys.release(this);
+ cancelHoldOk();
if (gameDay != null) gameDay.shutdown();
unregisterReceiver(packageReceiver);
wallpaperPlayer.close();
@@@ -1345,12 -1327,10 +1349,13 @@@
*/
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
- // Vendor keys (TCL Netflix button, 4062) never reach the key services, only the focused window.
- if (event.getKeyCode() >= 1000 && RemoteKeys.handle(this, event, homeAppKeys.get(event.getKeyCode()), null)) return true;
+ // Vendor keys (TCL Netflix button, 4062) never reach the key services, only the focused window, so their
+ // "hold:" entries run here too or nowhere. Only while resumed: onPause releases Home's holds, and a DOWN
+ // taken after that would arm one nothing releases.
+ if (resumed && event.getKeyCode() >= 1000 && RemoteKeys.handle(this, event, homeAppKeys.get(event.getKeyCode()),
+ homeHoldAppKeys.get(event.getKeyCode()))) return true;
if (handleSettingsKey(event)) return true;
+ if (holdOk(event)) return true;
if (tileMenuEnabled && !reordering && openPopup == null && cardPrompt == null
&& event.getKeyCode() == KeyEvent.KEYCODE_MENU) {
int position = focusedTilePosition();