Repository navigation
Description
Part: Launcher (the home screen), install script
TV: XGIMI Elfin Plus projector (WK03C, device altai, MediaTek), Android 11, kernel 4.19.116, remote "XGIMI RC"
What happened
With the stock Google TV home (launcherx) disabled, the remote's gear button never opened the launcher's quick settings panel, even with settings_key_panel on, HomeKeyService enabled and bound (dumpsys accessibility listed it under Bound services) and settings_key_keycodes set.
getevent -ltshows the gear as/dev/input/event3 EV_KEY KEY_F8(MSC_SCAN00070041), so the press does reach Android.- A keycode list was no use: the key layout file for this remote (
/vendor/usr/keylayout/Vendor_000d_Product_3838.kl) can't be read from adb shell, andlogcatprints no key lines here, so I could not tell which Android keycode scancode 66 becomes.[139](F8) did nothing, and injected keys (input keyevent) don't go through the helper on this set, so they proved nothing either. - Separately,
launcherxwas switched back on repeatedly, within minutes ofpm disable-user. Each time it was on, the gear (and Home) opened Google TV, and the helper never saw the key. This looks like the XGIMIxrmservicebehaviour described in examples: XGIMI MoGo 3 Pro profile button crashes xrmservice and sets off autofocus; "KEYCODE_F6:ignore" stops it #3121 (it starts alauncherxactivity and re-enableslauncherxon its remote keys). launcherxwas also enabled again after sometools/theme.shruns; I could not tell why.
What fixed it
settings_key_scancodes (config.xml only) with the gear's scancode:
<integer-array name="settings_key_scancodes">
<item>66</item>
</integer-array>Rebuilt (tools/docker-build.sh), reinstalled with SKIP_BUILD=1 HOME_KEY_SERVICE=1 RESTORE_KEY_SERVICES=1 launcher/build-and-install.sh, launcherx and setupwraith disabled, theme with "settings_key_panel": true. Pressing the real gear button then opens the quick settings panel, over Home and over Netflix.
Suggestions
- docs: say that when the keycode can't be found (key layout unreadable, no InputReader log), the evdev code from
getevent -lt(hereKEY_F8= 66) works as a scancode entry insettings_key_scancodes. That entry only exists in config.xml, so it needs a rebuild;Config.javadoes not read it from a theme'sconfig.json. Reading it fromconfig.jsonlikesettings_key_keycodeswould remove the rebuild. - an
examples/entry for the Elfin Plus (WK03C) would be useful: gear is scancode 66 /KEY_F8. launcherxre-enable afterpm disable-useron XGIMI (see examples: XGIMI MoGo 3 Pro profile button crashes xrmservice and sets off autofocus; "KEYCODE_F6:ignore" stops it #3121 and Launcher: keep accessibility helpers enabled across a reboot #3199): the gear press and Home both end up on Google TV until it is disabled again.
Output (getevent -lt, gear pressed three times):
/dev/input/event3: EV_MSC MSC_SCAN 00070041
/dev/input/event3: EV_KEY KEY_F8 DOWN
/dev/input/event3: EV_KEY KEY_F8 UP
Activity
docs: the gear's other number, the EV_KEY one, when MSC_SCAN matches …
Merge PR #3614: docs: the gear key has a second number to try when th…