Skip to content

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

Merge PR #2302: Launcher: launch_actions takes "package=view:uri" to open a URI in the app

Gathin23c621b7c001d0
diff --cc launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.java
index 32d1b7d54,8a7f255ef..453d294a0
--- a/launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/LaunchActions.java
@@@ -15,13 -20,17 +20,27 @@@ final class LaunchActions
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, including
+ * an empty id ("input:" alone), which falls back to a normal launch rather than an empty input switch. */
+ static String inputId(String action) {
+ if (action == null || !action.startsWith(INPUT_PREFIX)) return null;
+ String id = action.substring(INPUT_PREFIX.length()).trim();
+ return id.isEmpty() ? null : id;
+ }
++
+ /** The URI of a "view:<uri>" value, or null for a plain action. */
+ static String viewUri(String value) {
+ if (value == null || !value.startsWith(VIEW_PREFIX)) return null;
+ String uri = value.substring(VIEW_PREFIX.length()).trim();
+ return uri.isEmpty() ? null : uri;
+ }
+
+ /** The intent for a launch_actions value, limited to its package: ACTION_VIEW on the URI, or the action. */
+ static Intent intent(String pkg, String value) {
+ String uri = viewUri(value);
+ Intent i = uri != null ? new Intent(Intent.ACTION_VIEW, Uri.parse(uri)) : new Intent(value);
+ return i.setPackage(pkg);
+ }
}
diff --cc launcher/app/src/main/res/values/config.xml
index a299be601,7a293556a..229221d84
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@@ -70,9 -63,8 +70,11 @@@
<!-- Tiles that open a screen of the app instead of its start screen: "package=action", sent to that package.
A tile whose action no longer resolves opens the app normally. MagentaTV's program guide:
- com.telekom.onetv.tv.pl=com.telekom.onetv.tv.pl.action.PROGRAM_GUIDE. "package=view:uri" opens that URI
- in the package instead (ACTION_VIEW): Bbox TV's live channels are fr.bouyguestelecom.tv.bbui=view:bbox://live. -->
+ com.telekom.onetv.tv.pl=com.telekom.onetv.tv.pl.action.PROGRAM_GUIDE. "package=input:<input id>" makes
+ the tile switch to that TV input instead (ids from dumpsys tv_input), e.g. a Live TV tile straight to
- HDMI 1: com.mediatek.wwtv.tvcenter=input:com.mediatek.tvinput/.hdmi.HDMIInputService/HW5. -->
++ HDMI 1: com.mediatek.wwtv.tvcenter=input:com.mediatek.tvinput/.hdmi.HDMIInputService/HW5. "package=view:uri"
++ opens that URI in the package instead (ACTION_VIEW): Bbox TV's live channels are
++ fr.bouyguestelecom.tv.bbui=view:bbox://live. -->
<string-array name="launch_actions">
</string-array>
diff --cc themes/README.md
index e92bb1fee,077058fa3..12d643424
--- a/themes/README.md
+++ b/themes/README.md
@@@ -51,7 -51,7 +51,7 @@@ A new key needs one there in the same p
| `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 |
- | `launch_actions` | list of `"package=action"` | Tiles and `top_bar_apps` buttons that open a screen of the app instead of its start screen; an action that no longer resolves opens the app normally (MagentaTV's guide: `com.telekom.onetv.tv.pl=com.telekom.onetv.tv.pl.action.PROGRAM_GUIDE`); `"package=input:<input id>"` makes a tile switch to that TV input instead (ids from `dumpsys tv_input`), e.g. `com.mediatek.wwtv.tvcenter=input:com.mediatek.tvinput/.hdmi.HDMIInputService/HW5` |
-| `launch_actions` | list of `"package=action"` | Tiles and `top_bar_apps` buttons that open a screen of the app instead of its start screen; an action that no longer resolves opens the app normally (MagentaTV's guide: `com.telekom.onetv.tv.pl=com.telekom.onetv.tv.pl.action.PROGRAM_GUIDE`). `"package=view:uri"` opens that URI in the package instead (Bbox TV's live channels: `fr.bouyguestelecom.tv.bbui=view:bbox://live`) |
++| `launch_actions` | list of `"package=action"` | Tiles and `top_bar_apps` buttons that open a screen of the app instead of its start screen; an action that no longer resolves opens the app normally (MagentaTV's guide: `com.telekom.onetv.tv.pl=com.telekom.onetv.tv.pl.action.PROGRAM_GUIDE`); `"package=input:<input id>"` makes a tile switch to that TV input instead (ids from `dumpsys tv_input`), e.g. `com.mediatek.wwtv.tvcenter=input:com.mediatek.tvinput/.hdmi.HDMIInputService/HW5`; `"package=view:uri"` opens that URI in the package instead (Bbox TV's live channels: `fr.bouyguestelecom.tv.bbui=view:bbox://live`) |
| `app_labels` | list of `"package=Name"` | A tile's name instead of the app's own (MagentaTV as `com.telekom.onetv.tv.pl=TV`) |
| `app_banners` | list of `"package=banner_name"` | A tile's artwork from a `banner_*` drawable bundled with the launcher (`banner_tv`: magenta with the Live TV glyph) |
| `input_action` | string | Action sent with an HDMI/AV row's channel URI when nothing handles the standard `VIEW` (XGIMI: `com.xgimi.action.hdmiPlayer`). Only a handler-less set gets here; any app that claims the channel MIME type takes the row instead, so check with `query-activities` ([#805](https://github.com/Gathin23/cleanyourtv/issues/805)) |