Skip to content

launcher: volume_pauses_filter, held volume repeats while the key helpers filter - #3586

Open
yrslykvl wants to merge 3 commits into
Gathin23:mainfrom
yrslykvl:volume-pauses-filter
Open

yrslykvl wants to merge 3 commits into
Gathin23:mainfrom
yrslykvl:volume-pauses-filter

Conversation

@yrslykvl

@yrslykvl yrslykvl commented Nov 8, 2026 •

Copy link
Copy Markdown

Adds volume_pauses_filter, an off-by-default switch for firmware where any key-filtering accessibility service stops a held volume key from repeating. On those sets the remote buttons only work through the key helpers, so key_filter: false is not an option, and the helpers never see the volume keys, so consume_volume_keys cannot repeat them.

Tested on: Xiaomi TV S Mini LED 55 2025 (MiTV-MOEU0, ladybird), Google TV 14

On this set the window policy changes volume once per press while the helpers filter keys. The helpers never see the volume keys (checked with a debug build), so they cannot repeat volume themselves. key_filter: false brings the repeat back, but this remote's Netflix (289), Prime Video (290) and YouTube (296) buttons, Apps and the gear are global keys (dumpsys window policy) that never reach an app. Only the helpers can catch them. mitv.service starts Netflix and Prime by package, and its Google TV gear handler is empty.

With the switch on, VolumePause (built like GamepadPassthrough) registers, in each helper, a VOLUME_CHANGED_ACTION receiver. A volume change drops FLAG_REQUEST_FILTER_KEY_EVENTS for 4 s, then puts it back:

  • the first press steps once;
  • a press or hold within those 4 s repeats as usual;
  • the buttons work again once the pause ends.

With the switch off, nothing new runs: no receiver is registered.

Verified on the TV:

  • dumpsys accessibility shows the A11yInputFilter gone right after a volume key and back after 5 s;
  • on the real remote, held volume is smooth after the first press, on Home and in YouTube;
  • app_keys 289/290/296, Apps and the gear still work.

Screenshot: docs/switches/volume_pauses_filter.jpg, the volume bar mid-ramp on Home. No unit test: the logic is all AccessibilityService and broadcast calls, with nothing to test off the TV.

If this touches the launcher

  • Verified on a real TV
  • D-pad checked from every edge: not affected, key routing only
  • No network, no background service, no new permission (a runtime receiver inside the existing helpers, only while the switch is on)
  • No new strings
  • Anything TV-specific is in config.xml or a theme, not in code

Checks:

  • ./gradlew testReleaseUnitTest lintRelease assembleRelease: 0 lint errors;
  • APK 587,793 B (+472 B over main), under the 589,824 B gate;
  • python3 -m unittest discover -s tests: all pass, with docs/switches/volume_pauses_filter.jpg added.

Second commit: examples/xiaomi-mitv-moeu0/ gets a config.json (gear 176, YouTube on both 190 and 296, Live TV com.mitv.livetv, volume_pauses_filter on) and a header note. The remote of the 55" 2025 unit tested here sends YouTube as 296 (KEYCODE_VIDEO_APP_8), not the 190 the list noted, and Netflix/Prime Video as 289/290. Firmware V816.0.25.12.1 and V816.0.26.10.12.1.

🤖 Generated with Claude Code

…pers filter

On a Xiaomi MOEU0 (Google TV 14) the window policy changes volume once
per press while any helper filters keys, so a held volume key never
repeats. The helpers never see the volume keys, so consume_volume_keys
cannot repeat them. key_filter false is no way out either: the remote's
Netflix (289), Prime Video (290) and YouTube (296), Apps and the gear are
global keys that never reach a window, so only the helpers can answer
them.

volume_pauses_filter (off by default, config.xml or a theme) adds
VolumePause, built like GamepadPassthrough. Each helper registers a
VOLUME_CHANGED_ACTION receiver. A volume change drops
FLAG_REQUEST_FILTER_KEY_EVENTS for 4 s and then puts it back. The first
press steps once, a press or hold within those 4 s repeats as usual, and
the buttons work again once the pause ends. It starts only with
key_filter on, and with the key off no receiver is registered. +472 B
APK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

maintainer-bot review · this one needs a maintainer decision · Leans: merge (62%)

Thanks for the careful digging into why held volume stops repeating on the MOEU0, including checking which remote keys only the key helpers can catch. Because the switch is off by default and config-only, and you tested it on the TV itself, it looks ready to go into the core as it is.

Why it goes to a maintainer: changes the Home/launch path (HomeKeyService.java), which usually needs a run on a real TV (confidence 0.62 < 0.85).
The bot's own suggestion would be: merge.

Checks

This is a suggestion; a maintainer makes the final call. A maintainer can comment /bot review to run it again.

Reviewed by maintainer-bot · runs on 0G Private Computer

…e_pauses_filter

Another MiTV-MOEU0 remote sends YouTube as 296 (KEYCODE_VIDEO_APP_8) instead of 190, and Netflix and
Prime Video as 289/290. config.json maps the gear (176) and both YouTube codes, points Live TV at
com.mitv.livetv and turns on volume_pauses_filter, so held volume ramps with the key helpers bound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yrslykvl
yrslykvl force-pushed the volume-pauses-filter branch from b0448ac to 8ca5646 Compare November 8, 2026 21:47
The end of a pause turns key filtering back on, which undid gamepad_passthrough for a connected gamepad
when a theme set both. The services now start VolumePause only with gamepad_passthrough off; config.xml
said so already, the code now does it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-leans:merge Held for the maintainer; the review leans merge launcher Changes under launcher/: the Android TV home screen app needs-maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant