Skip to content

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

Merge branch 'pr-11' into xiaomi-tv-adb-debloat-67357739

Gathin23ae952aef25e4
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index c384905cd,9add607e6..1983ab73e
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -445,16 -414,12 +447,21 @@@ public class MainActivity extends Activ
if (ha != hb) return ha ? -1 : 1;
return String.valueOf(a.loadLabel(this)).compareToIgnoreCase(String.valueOf(b.loadLabel(this)));
});
+ // Some TVs (Sony) report every HDMI port as connected whether or not anything is plugged in,
+ // so drop the HDMI status then. A TV with every port really in use loses it too.
+ int hdmiPorts = 0, hdmiConnected = 0;
+ for (TvInputInfo info : inputs) {
+ if (!info.isPassthroughInput() || info.getType() != TvInputInfo.TYPE_HDMI) continue;
+ hdmiPorts++;
+ if (tim.getInputState(info.getId()) == TvInputManager.INPUT_STATE_CONNECTED) hdmiConnected++;
+ }
+ boolean hdmiStateBogus = hdmiPorts > 1 && hdmiConnected == hdmiPorts;
for (TvInputInfo info : inputs) {
+ if (info.getType() == TvInputInfo.TYPE_TUNER
+ && (info.getServiceInfo().applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
+ && (tunerId == null || info.getId().compareTo(tunerId) < 0)) {
+ tunerId = info.getId();
+ }
if (!info.isPassthroughInput()) continue;
CharSequence l = info.loadLabel(this);
String label = l == null ? info.getId() : l.toString();