Skip to content

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

fix(input): resolve CEC child-input IDs to parent input port in openInput

r3ha7fa2aa84275a
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 5be43c946..8d812981b 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -2588,6 +2588,16 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
* throws SecurityException, which used to take Home down with it (YaOS before the manifest asked
* for ACCESS_TV_SOURCE). */
private void openInput(String inputId) {
+ TvInputManager tim = (TvInputManager) getSystemService(TV_INPUT_SERVICE);
+ if (tim != null) {
+ try {
+ TvInputInfo info = tim.getTvInputInfo(inputId);
+ if (info != null && info.getParentId() != null) {
+ inputId = info.getParentId();
+ }
+ } catch (Throwable ignored) {
+ }
+ }
Integer source = mappedSource(inputId);
if (source != null && source >= 0 && !inputAction.isEmpty()) {
try {