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
docs: the Mi TV 4A's key-helper trade on Android TV 10 (#2446)
xbsheng33a263ef8cbd
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.mdindex 7fd3a0ca2..0d63435f0 100644--- a/docs/TROUBLESHOOTING.md+++ b/docs/TROUBLESHOOTING.md@@ -1167,7 +1167,12 @@ path that drops the repeats, before an app sees them; the launcher's own helpersthey do not map, so they are not consuming the volume key. The same was reported on a Xiaomi MiTV-MOSR4(`irobot`, Android 11, `RTM5.220609.003.1265`) with the launcher's own helpers, both and `InputKeyService`alone (#944), where the empty list was not tried because it also unhooks the buttons the helpers were-installed for. An onn 4K Streaming Box (`YOC`, Google TV 14, `URO4.260304.011.B1.15051976`) does the same with+installed for. A Xiaomi Mi TV 4A (`MiTV-MOOQ1`, `tarzan`, MediaTek, Android TV 10, `QTG3.200305.006.6148`, #2446)+does the same with `InputKeyService` alone, and the empty list was run there: holding Volume Up ramped again with+`accessibility_enabled 0`, and the helper written back stepped it once more. On that set the helper is also what+answers Input, because the firmware's `GlobalKey` starts `VIEW_INPUTS` with the component+`com.google.android.tvlauncher/.inputs.InputsPanelActivity` written into it, so `handle_view_inputs` with+`INPUT_KEY_SERVICE=1` is the route once launcherx is gone. An onn 4K Streaming Box (`YOC`, Google TV 14, `URO4.260304.011.B1.15051976`) does the same with`HomeKeyService` alone; there `key_filter` false (config.xml or a theme) brought the repeat back with the helperstill bound, so a helper kept for something other than keys need not cost it. A Hisense 75U75N (`hengshan`,Google TV 12, `STT2.230310.002`) with `HomeKeyService` alone does it too, and its log shows where the repeat goes:diff --git a/docs/devices/tcl-55p71b-g09-key-repeat.md b/docs/devices/tcl-55p71b-g09-key-repeat.mdindex 20d041aa9..93db8e5d9 100644--- a/docs/devices/tcl-55p71b-g09-key-repeat.md+++ b/docs/devices/tcl-55p71b-g09-key-repeat.md@@ -91,7 +91,8 @@ on this set clearing the list unhooks the buttons the helpers were installed fordisabled, its Input, Settings, YouTube and Netflix buttons reach only`com.xiaomi.android.tvsetup.partnercustomizer/.GlobalKeyReceiver`, which starts launcherx activities andcrashes (the [MOSR4 note](xiaomi-mitv-mosr4.md) has that part, and its install line passes both helpers).-So "the ramp returns with no service bound" is still measured on the G09 alone. And the build string in+So "the ramp returns with no service bound" was measured on the G09 alone until the Mi TV 4A below ran that+control too. And the build string inthe issue is not the one that note carries (`RTM5.220609.003/1585`, written on another unit of the samemodel), so treat the two as separate units until both fingerprints are read: the model, the firmwarefamily and the behaviour are what they agree on.@@ -210,6 +211,45 @@ Single presses step once either way. `settings put secure long_press_timeout` ishere: the dispatcher marks its first repeat `FLAG_LONG_PRESS`, which is what Home's long-press action waitsfor, and with 800 set that action still fired 400 ms after the down, before and after a reboot.+## A Xiaomi Mi TV 4A on Android TV 10, with the empty-list control run++A version the sections above do not have: Xiaomi Mi TV 4A (MiTV-MOOQ1, `tarzan`, MediaTek), Android TV 10+(SDK 29), firmware `QTG3.200305.006.6148`, stock Xiaomi Bluetooth remote, launcher built from a `main`+download of 2026-10-28 ([#2446](https://github.com/Gathin23/cleanyourtv/issues/2446)).+`com.google.android.tvlauncher` was disabled by `launcher/build-and-install.sh`, and the two buttons this+owner wanted reach the stock launcher by name rather than through a vendor keycode:++- **Input** (`KEYCODE_TV_INPUT`, 178): the firmware's `GlobalKey` handler does not pass the key on, it starts+ `com.android.tv.action.VIEW_INPUTS` with an explicit component,+ `com.google.android.tvlauncher/.inputs.InputsPanelActivity`, so with tvlauncher disabled `logcat` ends+ `GlobalKey: ActivityNotFound` and the press does nothing at all. `INPUT_KEY_SERVICE=1` with+ `handle_view_inputs` true answers that intent with the launcher's Inputs menu, which is what the switch is+ for.+- **PatchWall** (`KEY_WWW`; `getevent -lt` prints `MSC_SCAN 000c0196` and then `KEY_WWW DOWN`): nothing once+ `com.mitv.tvhome.atv` is disabled. `scan:150:com.spotify.tv.android` in `app_keys` opens Spotify instead -+ the remap the [redmi-mitv-mooq3 list](../../examples/redmi-mitv-mooq3/debloat.txt) records as not yet tried+ on a real remote, tried here.++`InputKeyService` was the only helper bound, `HomeKeyService` was never enabled on this set, and+`dumpsys accessibility` listed it as one `Service[label=Inicio, ..., capabilities=8]`:++| `enabled_accessibility_services` | holding Volume Up |+| --- | --- |+| `com.gathin.tvhome/.InputKeyService` | one step per press |+| `''`, with `accessibility_enabled 0` | ramps continuously |+| `InputKeyService` written back | one step per press again |++The third row is the measurement [#944](https://github.com/Gathin23/cleanyourtv/issues/944) could not take.+Clearing the list kills both buttons here too, so it is a test and not a configuration to stay in, but it was+run to see the ramp come back - which is why the sentence above no longer rests on the G09 alone.+`consume_volume_keys` was not tried, and `HomeKeyService` alone was not tried either, so this set gives one+helper's row rather than the all-or-nothing bisect the G09 has.++Android TV 10 is older than the `android12-release` source read above, which was not re-read for SDK 29: the+mechanism claimed here is the `capabilities=8` in the dump and the three rows, not a line of+`KeyboardInterceptor`. The owner kept both buttons and lives with the stepped volume - the second Choice+below - so nothing in that section changes.+## Choices- **Keep the repeat and skip the helpers.** Do not pass `INPUT_KEY_SERVICE=1` or `HOME_KEY_SERVICE=1`diff --git a/tests/test_mooq1_key_repeat.py b/tests/test_mooq1_key_repeat.pynew file mode 100644index 000000000..f60eec07b--- /dev/null+++ b/tests/test_mooq1_key_repeat.py@@ -0,0 +1,134 @@+"""Pins the Android TV 10 data point for the key-helper/auto-repeat trade (#2446).++docs/devices/tcl-55p71b-g09-key-repeat.md carries one section per set, and the #944 section has to say+the empty-list control was not run there, so "the ramp returns with no service bound" rested on the G09+alone. #2446 is a Xiaomi Mi TV 4A (MiTV-MOOQ1, Android TV 10) where the owner ran that control both ways,+and where the helper is needed for a reason the note's G09 table does not have: the firmware addresses+VIEW_INPUTS to launcherx's own Inputs panel by name, so the launcher answers it with handle_view_inputs+rather than with a vendor keycode. These tests keep the section to what the report measured, hold its+config advice to switches the launcher actually reads, and keep the troubleshooting entry and the note's+own cross-reference in step.+"""+import re+import unittest+from pathlib import Path+++ROOT = Path(__file__).resolve().parents[1]+G09 = ROOT / "docs" / "devices" / "tcl-55p71b-g09-key-repeat.md"+MOOQ3 = ROOT / "examples" / "redmi-mitv-mooq3" / "debloat.txt"+TROUBLE = ROOT / "docs" / "TROUBLESHOOTING.md"+THEMES = ROOT / "themes" / "README.md"+CONFIG_XML = ROOT / "launcher" / "app" / "src" / "main" / "res" / "values" / "config.xml"+JAVA = ROOT / "launcher" / "app" / "src" / "main" / "java"++HEADING = "## A Xiaomi Mi TV 4A on Android TV 10, with the empty-list control run"+BUILD = "QTG3.200305.006.6148"+INPUTS_PANEL = "com.google.android.tvlauncher/.inputs.InputsPanelActivity"+TROUBLE_HEADING = "## A key helper is bound and a held remote button stopped repeating"+++def flat(path):+ return re.sub(r"\s+", " ", path.read_text(encoding="utf-8"))+++def section_of(text, heading):+ """The flattened body under `heading`, up to the next `##` heading; None when it is not there."""+ flat_text = re.sub(r"\s+", " ", text)+ if heading not in flat_text:+ return None+ rest = flat_text.split(heading, 1)[1]+ following = re.search(r"\s##\s", rest)+ return rest if following is None else rest[:following.start()]+++def links(path):+ text = path.read_text(encoding="utf-8")+ return [str((path.parent / target).resolve()) for target in re.findall(r"\]\(([^)\s]+)\)", text)+ if not target.startswith(("http", "#"))]+++class SectionTest(unittest.TestCase):+ def setUp(self):+ body = section_of(G09.read_text(encoding="utf-8"), HEADING)+ self.assertIsNotNone(body, f"{HEADING} is gone from the G09 note")+ self.section = body or ""++ def test_says_which_set_and_which_build(self):+ for needle in ("#2446", "MiTV-MOOQ1", "`tarzan`", BUILD, "Android TV 10", "SDK 29", "MediaTek"):+ with self.subTest(needle=needle):+ self.assertIn(needle, self.section)++ def test_keeps_all_three_rows_of_the_control(self):+ for needle in ("`com.gathin.tvhome/.InputKeyService` | one step per press",+ "`''`, with `accessibility_enabled 0` | ramps continuously",+ "`InputKeyService` written back | one step per press again"):+ with self.subTest(needle=needle):+ self.assertIn(needle, self.section)++ def test_reports_the_control_as_run_and_says_what_it_costs(self):+ self.assertIn("Clearing the list kills both buttons here too", self.section)+ self.assertIn("was", self.section)+ self.assertNotIn("empty-list control was not run", self.section,+ "this report ran the control; only the sections that did not may say otherwise")++ def test_names_what_was_not_tried(self):+ self.assertIn("`consume_volume_keys` was not tried", self.section)+ self.assertIn("`HomeKeyService` alone was not tried", self.section)++ def test_the_input_button_route_matches_the_launcher(self):+ for needle in ("`KEYCODE_TV_INPUT`", INPUTS_PANEL, "ActivityNotFound", "handle_view_inputs",+ "INPUT_KEY_SERVICE=1", "VIEW_INPUTS"):+ with self.subTest(needle=needle):+ self.assertIn(needle, self.section)+ self.assertIn("handle_view_inputs", flat(THEMES),+ "the Keys table no longer documents the switch this section tells the owner to set")+ self.assertIn("handle_view_inputs", CONFIG_XML.read_text(encoding="utf-8"),+ "the bool the section names is not in config.xml")+ if JAVA.is_dir():+ java = "\n".join(p.read_text(encoding="utf-8") for p in JAVA.rglob("*.java"))+ self.assertIn("handle_view_inputs", java, "the launcher no longer reads that switch")+ self.assertIn("KEYCODE_TV_INPUT", java,+ "the keycode the section names is not one the helper still answers")++ def test_the_patchwall_route_is_the_one_the_mooq3_list_left_open(self):+ for needle in ("`KEY_WWW`", "`MSC_SCAN 000c0196`", "`com.mitv.tvhome.atv`",+ "`scan:150:com.spotify.tv.android`"):+ with self.subTest(needle=needle):+ self.assertIn(needle, self.section)+ self.assertIn("has not been tried on the real remote yet", flat(MOOQ3),+ "the mooq3 list is what this section answers; it no longer leaves the remap open")+ self.assertIn("records as not yet tried", self.section)++ def test_no_fix_is_promised(self):+ self.assertNotIn("solves", self.section.lower())+ if JAVA.is_dir():+ java = "\n".join(p.read_text(encoding="utf-8") for p in JAVA.rglob("*.java"))+ self.assertNotIn("adjustSuggestedStreamVolume", java,+ "the launcher now synthesises the repeat: this section's wording has to change")++ def test_the_note_no_longer_credits_the_control_to_the_g09_alone(self):+ text = flat(G09)+ self.assertNotIn("still measured on the G09 alone", text)+ self.assertIn("was measured on the G09 alone until the Mi TV 4A below ran that", text,+ "the #944 section has to point forward to this one")+++class EntryPointsTest(unittest.TestCase):+ def test_troubleshooting_carries_the_set(self):+ text = flat(TROUBLE)+ self.assertEqual(text.count(TROUBLE_HEADING), 1)+ body = text[text.index(TROUBLE_HEADING):]+ body = body[:body.find(" ## ")] if " ## " in body else body+ for needle in ("MiTV-MOOQ1", BUILD, "#2446", INPUTS_PANEL, "empty list was run"):+ with self.subTest(needle=needle):+ self.assertIn(needle, body)++ def test_links_resolve(self):+ for target in links(G09):+ with self.subTest(target=target):+ self.assertTrue(Path(target).exists(), "relative link target does not exist")+++if __name__ == "__main__":+ unittest.main()diff --git a/tests/test_mosr4_key_repeat.py b/tests/test_mosr4_key_repeat.pyindex 8e8e994ba..6458d74fb 100644--- a/tests/test_mosr4_key_repeat.py+++ b/tests/test_mosr4_key_repeat.py@@ -68,7 +68,7 @@ class SecondUnitTest(unittest.TestCase):def test_names_the_missing_control_instead_of_borrowing_it(self):self.assertIn("empty-list control was not run", self.section)- self.assertIn("still measured on the G09 alone", self.section,+ self.assertIn("was measured on the G09 alone until", self.section,"the control was not repeated on this set, so it must not be reported as if it was")def test_names_the_capability_and_how_it_was_read(self):