Closed Bug 1248047 Opened 8 years ago Closed 8 years ago

Make key event handling more efficient

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect)

All
Android
defect
Not set
normal

Tracking

(firefox47 fixed)

RESOLVED FIXED
Firefox 47
Tracking Status
firefox47 --- fixed

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(3 files)

      No description provided.
Right now, sendKeyEvent does a round trip from the IC thread to the UI
thread back to the IC thread. This patch makes it stay on the IC thread.
Attachment #8718999 - Flags: review?(esawin)
Right now, processKey uses a IC-thread proxy in order to handle key events on
the UI thread. This patch makes it post the key event to the IC thread and
avoid the proxy entirely. That also lets us get rid of a lot of code.
Attachment #8719000 - Flags: review?(esawin)
When using physical keyboards, we get key events on the UI thread. To
improve performance, and to support key listeners better, we should
switch the IC thread to the UI thread in that case.
Attachment #8719001 - Flags: review?(esawin)
Attachment #8718999 - Flags: review?(esawin) → review+
Comment on attachment 8719000 [details] [diff] [review]
Simplify GeckoInputConnection.processKey (v1)

Review of attachment 8719000 [details] [diff] [review]:
-----------------------------------------------------------------

Nice code reductions.
Attachment #8719000 - Flags: review?(esawin) → review+
Comment on attachment 8719001 [details] [diff] [review]
Switch back to UI thread when using physical keyboards (v1)

Review of attachment 8719001 [details] [diff] [review]:
-----------------------------------------------------------------

Do we handle the case where a hardware keyboard is present, but software keyboard is used for input correctly?

::: mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java
@@ +761,1 @@
>          }

The two if-statements can be combined, identical return value.
(In reply to Eugen Sawin [:esawin] from comment #5)
> Comment on attachment 8719001 [details] [diff] [review]
> Switch back to UI thread when using physical keyboards (v1)
> 
> Review of attachment 8719001 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Do we handle the case where a hardware keyboard is present, but software
> keyboard is used for input correctly?

Yep, soft keyboards should work just fine.
Attachment #8719001 - Flags: review?(esawin) → review+
https://hg.mozilla.org/mozilla-central/rev/0ea261ff82d3
https://hg.mozilla.org/mozilla-central/rev/3d5c8266acb1
https://hg.mozilla.org/mozilla-central/rev/cb08ccbe74a3
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: