Closed Bug 950573 Opened 11 years ago Closed 11 years ago

Built-in Keyboard app could not input keys after it resumed from OOM

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3T+, b2g-v1.3T fixed)

RESOLVED FIXED
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- fixed

People

(Reporter: rudyl, Assigned: rudyl)

References

Details

(Whiteboard: [3rd-party-keyboard])

Attachments

(1 file)

After switching keyboard OOP on, we would encounter an issue that the built-in keyboard could input keys even when the UI is correctly shown.

STR
===
1. Enabled keyboard OOP by setting 'keyboard.3rd-party-app.enabled': true in build/settings.js.
2. Try to launch many apps to make keyboard app killed due to OOM.
   (Or just kill the process)
3. Click on an input to launch the keyboard app again.
4. Type on the keyboard UI.

Expected result: everything works as normal.
Actual result: The UI and feedback (sound/vibration) works, but the keys pressed were not sent to the input field)
Attached patch Patch V1Splinter Review
[Root Cause]
When the keyboard app is resumed after it was killed (due to OOM), most of the time, it goes to the route to invoke showKeyboard() in initKeyboard().
In this code path, we have to wait for the input method engine to load and then do showKeyboard(), or the latin input method won't get the correct state  - because its activate() was not invoked during showKeyboard().

[Solution]
Correct the init flow so that showKeyboard() would be invoked after setKeyboardName(), which will ensure input method engine is loaded.

--

Tim, could you help review this patch?
Attachment #8347942 - Flags: review?(timdream)
Attachment #8347942 - Flags: feedback?(gchen)
Comment on attachment 8347942 [details] [diff] [review]
Patch V1

feedback+
Attachment #8347942 - Flags: feedback?(gchen) → feedback+
Comment on attachment 8347942 [details] [diff] [review]
Patch V1

Ouch.
Attachment #8347942 - Flags: review?(timdream) → review+
Merged to Gaia master,
https://github.com/mozilla-b2g/gaia/commit/5376e75091d1347b8df6abb493d91ed8d7dce185

--
Tim, Gary,

Thanks for the review.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Attachment #8347942 - Attachment is patch: true
Attachment #8347942 - Attachment mime type: text/x-github-pull-request → text/plain
See bug 991803 for the a easy STR to reproduce this issue on tarako.
That one has been nominated as v1.3T?, so carry forward here.

Since we backport the keyboard killing and resuming feature to v1.3t (see Bug 957880), we would need the fix here to correctly resume the keyboard app.
blocking-b2g: --- → 1.3T?
Joe,

ni to you for this issue, in case this won't be seen in triage since it has been resolved fixed months ago.
Please help read comment 6.
Thanks.
Flags: needinfo?(jcheng)
triage: 1.3T+ given the device can OOM due to limited memory, let's fix this in 1.3T
blocking-b2g: 1.3T? → 1.3T+
Flags: needinfo?(jcheng)
Verified the fix on Tarako 1.3T.  Keyboard worked correctly after crashing it using the steps in bug 991803

1.3T Environmental Variables:
Device: Tarako 1.3T MOZ
BuildID: 20140501014002
Gaia: d26a776beae0070b0032248a2ce482bbe6321a6d
Gecko: e90f4b655511
Version: 28.1
Firmware Version: sp6821a-Gonk-4.0-4-29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: