Skip to content

Declare canRequestFilterKeyEvents so the Home Button Fix receives key events - #129

Open
williavs wants to merge 1 commit into
leanbitlab-org:masterfrom
williavs:fix/accessibility-key-filter
Open

Declare canRequestFilterKeyEvents so the Home Button Fix receives key events#129
williavs wants to merge 1 commit into
leanbitlab-org:masterfrom
williavs:fix/accessibility-key-filter

Conversation

@williavs

@williavs williavs commented Sep 2, 2026

Copy link
Copy Markdown

accessibility_service_config.xml sets flagRequestFilterKeyEvents but never declares the matching capability. Android ignores the flag without android:canRequestFilterKeyEvents="true", so the service binds with no capabilities and onKeyEvent never fires. Home button presses fall through to the stock launcher, which makes Method 2 in the README a no-op.

Seen on a Hisense Google TV (Android 12):

  • before: dumpsys accessibilityService[label=LTvLauncher Home Button Fix, feedbackType[FEEDBACK_GENERIC], capabilities=0, ...]; Home opens Google TV
  • after: capabilities=8; Home logs START u0 {flg=0x14000000 cmp=com.leanbitlab.ltvL/.MainActivity} from uid 10115 and opens LtvLauncher

One attribute added. Note for testing: adb shell input keyevent KEYCODE_HOME bypasses the accessibility key filter, so this has to be checked with the physical remote.

… events

accessibility_service_config.xml asks for flagRequestFilterKeyEvents but never
declares the matching capability. Android silently drops the flag in that case:
the service binds with capabilities=0 and onKeyEvent never fires, so Home
presses fall through to the stock launcher.

Verified on a Hisense Google TV (Android 12): dumpsys accessibility shows
capabilities=8 after this change and a Home press starts MainActivity.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant