Skip to content

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

launcher: offer stock root channel URI for Live TV

GaneshVarma170142bc2a7db
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 179614434..cf3f5bea8 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -3020,6 +3020,8 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
boolean connectedOnly = inputsConnectedOnly;
List<View> folded = new ArrayList<>();
boolean sawNonHdmi = false;
+ // An explicit root URI asks the Live TV app to leave any HDMI source selected by its own UI.
+ boolean rootChannel = TvContract.Channels.CONTENT_URI.toString().equals(liveTvInputId);
String tunerId = null;
boolean tunerIsHw = false;
boolean tunerIsAnalog = false;
@@ -3059,7 +3061,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
for (TvInputInfo info : inputs) {
if (info.getType() == TvInputInfo.TYPE_TUNER
&& (info.getServiceInfo().applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
- && (liveTvInputId.isEmpty() || liveTvInputId.equals(info.getId()))) {
+ && (liveTvInputId.isEmpty() || rootChannel || liveTvInputId.equals(info.getId()))) {
// Prefer a hardware tuner: the framework names those ".../HW<n>". System apps such as
// AirPlay also register software inputs of type TUNER and may sort first (seen on TCL G05).
// Among tuners of the same kind, skip an analog input when another is present.
@@ -3163,13 +3165,20 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
// An explicit tuner uses its channel collection (e.g. DVB-S rather than DVB-T/C).
// Keep the legacy passthrough route for automatic selection: some OEM players need it.
// If the configured input is absent, tunerId stays null and the app opens normally.
- boolean configured = !liveTvInputId.isEmpty();
+ boolean configured = !liveTvInputId.isEmpty() && !rootChannel;
Intent tuned = new Intent(Intent.ACTION_VIEW)
.setDataAndType(configured ? TvContract.buildChannelsUriForInput(tunerId)
: TvContract.buildChannelUriForPassthroughInput(tunerId),
configured ? TvContract.Channels.CONTENT_TYPE : TvContract.Channels.CONTENT_ITEM_TYPE)
.setPackage(liveTvPkg);
- if (tuned.resolveActivity(getPackageManager()) != null) liveTv = tuned;
+ ComponentName handler = tuned.resolveActivity(getPackageManager());
+ if (handler != null) {
+ // On some MediaTek sets the tuner passthrough URI leaves the app's HDMI source selected.
+ // The stock launcher addresses the same activity with the root channel URI instead (#1941).
+ liveTv = rootChannel
+ ? new Intent(Intent.ACTION_VIEW).setData(TvContract.Channels.CONTENT_URI).setComponent(handler)
+ : tuned;
+ }
}
if (liveTv != null) {
if (rows.getChildCount() > 0) addSeparator(rows);
diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xml
index c963338f1..bb76d0a77 100644
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@ -52,10 +52,12 @@
to that package instead, and the app starts normally. Leave empty to omit. -->
<string name="live_tv_action" translatable="false"></string>
- <!-- Optional exact system tuner ID for the Inputs menu's Live TV row, e.g. the DVB-S input on
+ <!-- Optional Live TV source for the Inputs menu. An exact system tuner ID, e.g. DVB-S on
a TV with separate antenna, cable and satellite tuners. It opens that input's channel
collection, restricted to live_tv_package. Empty keeps automatic selection and its existing
- OEM passthrough route. If the ID is absent or the app cannot handle the collection, open
+ OEM passthrough route. On Xiaomi MiTV-MSSP1 (#1941), set this to the exact value
+ content://android.media.tv/channel to use the stock launcher's root channel URI instead.
+ If the ID is absent or the app cannot handle the collection, open
the Live TV app normally instead of selecting a different input. A wrong but registered ID
can open the app's tuner setup screen instead; that is not detected as a fallback condition.
Use a verified input ID, or leave this empty. See docs/devices/haam-r4.md. -->
diff --git a/themes/README.md b/themes/README.md
index 9fe471a6e..8f980e7d0 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -47,7 +47,7 @@ A new key needs one there in the same pull request.
| `fill_dock` | bool | Fill the dock slots `dock_apps` leaves free with the first grid apps (true by default); false leaves them empty |
| `hidden_apps` | list of package names | Never shown as tiles |
| `live_tv_package`, `live_tv_action` | string | The Live TV app and, if it has no leanback entry, the action to start it with |
-| `live_tv_input_id` | string | Exact system tuner for the Inputs menu's Live TV row; opens its channel collection. Empty keeps automatic selection. Missing input or unsupported collection falls back to the app's normal launch. [HAAM satellite example](../docs/devices/haam-r4.md) |
+| `live_tv_input_id` | string | Live TV source for the Inputs menu: an exact system tuner ID opens its channel collection. The special value `content://android.media.tv/channel` opens the stock launcher's root channel URI on Xiaomi MiTV-MSSP1 (#1941). Empty keeps automatic selection. Missing input or unsupported collection falls back to the app's normal launch. [HAAM satellite example](../docs/devices/haam-r4.md) |
| `source_panel_service`, `source_panel_action` | string | The TV's own source panel, for sets with no TvInputManager: a service, or an activity (BYINTEK U4). Without a Live TV app, the Inputs pill opens it directly |
| `source_panel_extra` | `"name=value"` | One int extra sent with the source panel (Coocaa OS: `control_center_command=100`) |
| `coocaa_sources` | bool | Coocaa OS (Skyworth, China): list the sources from `com.skyworth.tv` in the Inputs menu, ahead of the source panel |