Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
Narrow to the input: prefix only; name the tested TV
ahmersdevdce1e52add4f
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.javaindex ea5b2a292..4421f967f 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java@@ -537,8 +537,9 @@ public class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {// already running resumes instead of restarting; only phone apps added from the library use plain MAIN.if (leanbackPackages.contains(e.pkg)) i.addCategory(Intent.CATEGORY_LEANBACK_LAUNCHER);String action = launchActions.get(e.pkg);- if (action != null && action.startsWith("input:")) {- listener.onOpenInput(action.substring("input:".length()).trim());+ String inputId = LaunchActions.inputId(action);+ if (inputId != null) {+ listener.onOpenInput(inputId);return;}if (action != null) {diff --git a/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.java b/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.javaindex 21af9fa8c..e62db4635 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.java@@ -143,14 +143,7 @@ final class AppLibraryDialog {if (popup.isShowing()) popup.update(width, height);}- /** Packages kept out of the catalogue entirely, never just hidden from Home: on some boards a hidden- * package must never be reachable from here either, e.g. a factory/AT/fac-menu package that can flip a- * factory-mode flag with no way back if opened even once (see examples/candy-android-tv-dvb2k/README.md).- * Elsewhere this is empty and hidden_apps still only hides an app from Home while leaving it in the- * library, unchanged for every package not listed here. */- private final Set<String> excludedFromLibrary;-- AppLibraryDialog(Activity activity, boolean animations, boolean reducedMotion, boolean selectionMode, boolean okOpens, Predicate<String> onHome, Runnable changed, Runnable dismissed, Set<String> excludedFromLibrary) {+ AppLibraryDialog(Activity activity, boolean animations, boolean reducedMotion, boolean selectionMode, boolean okOpens, Predicate<String> onHome, Runnable changed, Runnable dismissed) {this.activity = activity;this.animations = animations;this.rtl = activity.getResources().getBoolean(R.bool.rtl_app_grid);@@ -160,7 +153,6 @@ final class AppLibraryDialog {this.onHome = onHome;this.changed = changed;this.dismissed = dismissed;- this.excludedFromLibrary = excludedFromLibrary;density = activity.getResources().getDisplayMetrics().density;panel = new LinearLayout(activity);panel.setLayoutDirection(rtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);@@ -237,7 +229,7 @@ final class AppLibraryDialog {if (info.activityInfo == null || !info.activityInfo.exported) continue;String pkg = info.activityInfo.packageName;if (Intent.CATEGORY_LEANBACK_LAUNCHER.equals(category)) tv.add(pkg);- if (!pkg.equals(self) && !excludedFromLibrary.contains(pkg) && !unique.containsKey(pkg)) unique.put(pkg, info);+ if (!pkg.equals(self) && !unique.containsKey(pkg)) unique.put(pkg, info);}}Map<String, String> names = new HashMap<>();diff --git a/launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.java b/launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.javaindex 3fb4f455b..ab684d4a3 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.java@@ -14,4 +14,11 @@ final class LaunchActions {T custom = resolver.apply(pkg, action);return custom != null ? custom : fallback;}++ private static final String INPUT_PREFIX = "input:";++ /** The TV input id from an "input:<id>" launch_actions value, or null when the value isn't one. */+ static String inputId(String action) {+ return action != null && action.startsWith(INPUT_PREFIX) ? action.substring(INPUT_PREFIX.length()).trim() : null;+ }}diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.javaindex 28596c7da..78caeaae6 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -1619,7 +1619,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {grid.post(() -> {if (libraryFocusPending && appLibrary == null && hasWindowFocus() && !isFinishing()) focusLibrary();});- }, hiddenApps);+ });openPopup = appLibrary.popup;appLibrary.show();}diff --git a/launcher/app/src/test/java/com/gathin/tvhome/LaunchActionsTest.java b/launcher/app/src/test/java/com/gathin/tvhome/LaunchActionsTest.javaindex b7d24321f..07cb13bb5 100644--- a/launcher/app/src/test/java/com/gathin/tvhome/LaunchActionsTest.java+++ b/launcher/app/src/test/java/com/gathin/tvhome/LaunchActionsTest.java@@ -33,4 +33,18 @@ public class LaunchActionsTest {assertSame(normal, LaunchActions.select("store", Map.of(), normal,(pkg, action) -> { throw new AssertionError("Unnecessary resolution"); }));}++ @Test public void inputIdStripsThePrefixAndTrimsTheId() {+ assertEquals("com.mediatek.tvinput/.hdmi.HDMIInputService/HW5",+ LaunchActions.inputId("input:com.mediatek.tvinput/.hdmi.HDMIInputService/HW5"));+ assertEquals("HW5", LaunchActions.inputId("input: HW5 "));+ assertEquals("", LaunchActions.inputId("input:"));+ }++ @Test public void inputIdIsNullForEverythingElse() {+ assertNull(LaunchActions.inputId(null));+ assertNull(LaunchActions.inputId("FEATURED_LAUNCH"));+ assertNull(LaunchActions.inputId("INPUT:HW5"));+ assertNull(LaunchActions.inputId("not-input:HW5"));+ }}