Declare canRequestFilterKeyEvents so the Home Button Fix receives key events - #129
Open
williavs wants to merge 1 commit into
Open
Declare canRequestFilterKeyEvents so the Home Button Fix receives key events#129williavs wants to merge 1 commit into
williavs wants to merge 1 commit into
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
accessibility_service_config.xmlsetsflagRequestFilterKeyEventsbut never declares the matching capability. Android ignores the flag withoutandroid:canRequestFilterKeyEvents="true", so the service binds with no capabilities andonKeyEventnever 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):
dumpsys accessibility→Service[label=LTvLauncher Home Button Fix, feedbackType[FEEDBACK_GENERIC], capabilities=0, ...]; Home opens Google TVcapabilities=8; Home logsSTART u0 {flg=0x14000000 cmp=com.leanbitlab.ltvL/.MainActivity} from uid 10115and opens LtvLauncherOne attribute added. Note for testing:
adb shell input keyevent KEYCODE_HOMEbypasses the accessibility key filter, so this has to be checked with the physical remote.