Skip to content

Conversation

@AgBKartikey
Copy link

No description provided.

Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
Signed-off-by: minaripenguin37 <alexfinhart@gmail.com>
Signed-off-by: RakeshBatra <raakesh.batra@rediffmail.com>
ShukakuZa pushed a commit that referenced this pull request Nov 9, 2024
Brief explanation:
We have these stages
- PWM interceptkeys
- Appside pre IME stage
- Appside IME stage
- Appside onKeyEvent handling
- PWM fallback

Currently Ctrl+space is handled in PWM fallback.
So, if app handles the key in onKeyEvent() then we never handle the shortcut. Some apps like browser are capturing all keys in onKeyEvent() for performance reasons or for scrolling. And this blocks the shortcut handling and makes it look flaky for the user.

With the change: Ctrl+Space will take priority over app onKeyEvent capturing since it happens in Appside IME stage. This is only done when IME is visible i.e. user is actively typing.

- User scenario#1: Ctrl+Space in browser while typing (i.e. IME is visible/active) -> language switch [This wasn't hapenning without the change]
- User scenario#2: Ctrl+Space is browser while not in text field -> No language switch since browser captures it in onKeyEvent() stage.
- User scenario#3: Ctrl+Space in apps that don't capture keyevents -> language switch due to PWM fallback

This change is just fixing the User scenario #1 other things are still the same. But it seems that's the most important use case where we want to prioritize IME capturing the shortcut over app.Also, we still allow apps to block IME capturing the shortcut by overriding dispatchPreIme() which allos apps to capture key events in Pre Ime stage, allowing some apps like Minecraft, and other games that want full control on keys and has their own input handling for typing, etc.

Test: atest InputMethodServiceTest
Bug: 301969005
Change-Id: I2098ef61e1c2a4d53a46497a87a7840bf287ab92
ShukakuZa pushed a commit that referenced this pull request Nov 14, 2024
Cmd line: /system/bin/servicemanager
ABI: 'x86_64'

"servicemanager" sysTid=202
  NOTE: Function names and BuildId information is missing for some frames due
  NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
  NOTE: found under the lib/ directory are readable.
  NOTE: On this device, run setenforce 0 to make the libraries readable.
  NOTE: Unreadable libraries:
  NOTE:   /system/lib64/bootstrap/libc.so
    #00 pc 00000000000babda  /system/lib64/bootstrap/libc.so
    #1 pc 0000000000017819  /system/lib64/libutils.so (android::Looper::pollAll(int, int*, int*, void**)+441) (BuildId: 2ed0ced7383d1676a37aed1236486ac3)
    #2 pc 0000000000011a25  /system/bin/servicemanager (main+1157) (BuildId: 509b83cb97addfa90aaa4ad911c2a3df)
    #3 pc 00000000000547a9  /system/lib64/bootstrap/libc.so

Bug: 314088872
Test: am hang, and check /data/anrs...
Change-Id: Ic754c0fbe13f6986e1493da4167fbbc8d2388304
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