[B2G][Keyboard] Keyboard does not always display when tapping on a text field

VERIFIED FIXED in Firefox OS v1.4

Status

Firefox OS
Gaia::Keyboard
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: Darren, Assigned: GaryChen)

Tracking

unspecified
1.3 C2/1.4 S2(17jan)
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:1.4+, firefox28 affected, b2g-v1.4 fixed)

Details

Attachments

(3 attachments)

(Reporter)

Description

4 years ago
Created attachment 8339439 [details]
Keyboard not Displaying

Repro Steps:
1. Load Buri build: 20131127040203
2. Open contacts app
3. Tap on the + icon to add a new contact
4. Select one of the text fields

Actual Results:
The keyboard does not load on the first text field selected.

Expected Results:
The keyboard will display when selecting a text field.

Environmental Variables
Device: (example:Leo v 1.1.0 Mozilla/ COM RIL)
Build ID: 20131127040203
Gecko: http://hg.mozilla.org/mozilla-central/rev/6ecf0c4dfcbe
Gaia: d4b9a3d271f0451b4d903a03c2b931b8cc092041
Platform Version: 28.0a1
Base Build: 20131115
(Reporter)

Comment 1

4 years ago
The logcat is from opening the e-mail app and tapping on compose a new e-mail and selecting to, also we did not see this issue yesterday so the regression will be between yesterday and today.
Looks like the keyboard went to a background process?  This might be what Zac saw?  Need to check with him in his logcat

11-27 10:45:30.756: E/Sandbox(2472): install_syscall_filter() failed
11-27 10:45:30.776: I/Gecko:ProcessPriorityManager(136): Add ChildID(65) into LRU pool
11-27 10:45:30.776: I/Gecko:ProcessPriorityManager(136): [Built-in Keyboard, child-id=65, pid=2472] Changing priority from FOREGROUND:CPU_NORMAL to BACKGROUND:CPU_NORMAL.
11-27 10:45:30.776: I/Gonk(136): Setting nice for pid 2472 to 18
11-27 10:45:30.776: I/Gonk(136): Changed nice for pid 2472 from 1 to 18.
11-27 10:45:30.786: I/Gecko:ProcessPriorityManager(136): Remove ChildID(65) from LRU pool
11-27 10:45:30.786: I/Gecko:ProcessPriorityManager(136): [Built-in Keyboard, child-id=65, pid=2472] Changing priority from BACKGROUND:CPU_NORMAL to FOREGROUND:CPU_NORMAL.
11-27 10:45:30.786: I/Gonk(136): Setting nice for pid 2472 to 1
11-27 10:45:30.796: I/Gonk(136): Changed nice for pid 2472 from 18 to 1.
Flags: needinfo?(zcampbell)
This was caused by bug 942790. It's already backed out.
Blocks: 942790
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(zcampbell)
Resolution: --- → FIXED

Updated

4 years ago
blocking-b2g: --- → 1.3+
Keywords: regression
I found that I could reproduce this issue when opening more apps in the background.

 1. Open more apps, like browser, marketplace.
 2. Open contact app and click on one of the input field.
    => Keyboard may not show up, as this issue stated.

Kanru,

Is this issue in your area?
How could we avoid comment 2 if we have done Bug 928270?

Thanks.
Flags: needinfo?(kchen)
I checked with Rudy. We found that when keyboard was killed due to OOM, it was not shown after it was recreated. Maybe a bug in the keyboard manager?
Flags: needinfo?(kchen)
(In reply to Kan-Ru Chen [:kanru] from comment #5)
> I checked with Rudy. We found that when keyboard was killed due to OOM, it
> was not shown after it was recreated. Maybe a bug in the keyboard manager?

Definitely a bug on keyboard manager. Gary, we need you here.
Flags: needinfo?(gchen)
This still blocks OOP-keyboard.
Blocks: 816874
Status: RESOLVED → REOPENED
Keywords: regression
Resolution: FIXED → ---
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #6)
> Definitely a bug on keyboard manager. Gary, we need you here.

Or, there could be some issues with keyboard app start-up code.
Created attachment 8339876 [details] [review]
pull request: https://github.com/mozilla-b2g/gaia/pull/14172

Hi all,
   I've send a patch for fixing issue in keyboard manager to handle keyboard OOM.
   It still doesn't work, I found even keyboard manager launch keyboard app again but keyboard app will not be shown.

   The root cause is keyboard app can not get 'inputContext', 'showkeyboard' will no be call in keyboard app so keyboard manager never get 'mozbrowserresize' form it until keyboard app receive 'oninputcontextchange'. 

Log in keyboard app:
keyboard.js:334 in getKeyboardSettings: kms getKeyboardSettings
keyboard.js:387 in initKeyboard: kms init
keyboard.js:515 in initKeyboard: kms inputcontext:null
Flags: needinfo?(gchen)
Depends on: 944397
Thanks Gary!

I've filed bug 944009.
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #10)
> Thanks Gary!
> 
> I've filed bug 944009.

cool, thanks I think is 944397.
(In reply to GaryChen [:GaryChen][:PYChen] from comment #9)
> Created attachment 8339876 [details] [review]
> pull request: https://github.com/mozilla-b2g/gaia/pull/14172
> 
> Hi all,
>    I've send a patch for fixing issue in keyboard manager to handle keyboard
> OOM.
>    It still doesn't work, I found even keyboard manager launch keyboard app
> again but keyboard app will not be shown.
> 
>    The root cause is keyboard app can not get 'inputContext', 'showkeyboard'
> will no be call in keyboard app so keyboard manager never get
> 'mozbrowserresize' form it until keyboard app receive
> 'oninputcontextchange'. 
> 
> Log in keyboard app:
> keyboard.js:334 in getKeyboardSettings: kms getKeyboardSettings
> keyboard.js:387 in initKeyboard: kms init
> keyboard.js:515 in initKeyboard: kms inputcontext:null

When a new IME iframe is created, you can get non-null inputcontext only after 
the `inputcontextchange` event fired. That's why inputcontext is null in function
`initKeyboard` at the beginning.

The `inputcontextchange` event should be fired a short while after the IME iframe loads.
Could you check if that event is correctly fired? If not, it is really a InputMethod API
bug.
(In reply to Yuan Xulei [:yxl] from comment #12)
> (In reply to GaryChen [:GaryChen][:PYChen] from comment #9)
> > Created attachment 8339876 [details] [review]
> > pull request: https://github.com/mozilla-b2g/gaia/pull/14172
> > 
> > Hi all,
> >    I've send a patch for fixing issue in keyboard manager to handle keyboard
> > OOM.
> >    It still doesn't work, I found even keyboard manager launch keyboard app
> > again but keyboard app will not be shown.
> > 
> >    The root cause is keyboard app can not get 'inputContext', 'showkeyboard'
> > will no be call in keyboard app so keyboard manager never get
> > 'mozbrowserresize' form it until keyboard app receive
> > 'oninputcontextchange'. 
> > 
> > Log in keyboard app:
> > keyboard.js:334 in getKeyboardSettings: kms getKeyboardSettings
> > keyboard.js:387 in initKeyboard: kms init
> > keyboard.js:515 in initKeyboard: kms inputcontext:null
> 
> When a new IME iframe is created, you can get non-null inputcontext only
> after 
> the `inputcontextchange` event fired. That's why inputcontext is null in
> function
> `initKeyboard` at the beginning.
> 
> The `inputcontextchange` event should be fired a short while after the IME
> iframe loads.
> Could you check if that event is correctly fired? If not, it is really a
> InputMethod API
> bug.

Yes, I have inserted console.log in 'oninputcontextchange' but it never be fired until user tap another input filed.
https://github.com/mozilla-b2g/gaia/pull/14172/files#diff-dc0c62addec9eb302ba0b292ac718a8cR501
See https://bugzilla.mozilla.org/show_bug.cgi?id=942790#c17.
blocking-b2g: 1.3+ → 1.3?
Let me see if I can find cause for this in platform...
Please be aware of STR in bug 944397 comment 3.
Assignee: nobody → gchen
Moving to 1.4? per offline discussion - we'll be keeping this preffed off for 1.3.
blocking-b2g: 1.3? → 1.4?
Created attachment 8345770 [details] [review]
pull request: https://github.com/mozilla-b2g/gaia/pull/14563

please help to review this patch.
Maybe you need bug 944397's patch manually since it does not land in Gecko.
Attachment #8345770 - Flags: review?(timdream)
Comment on attachment 8345770 [details] [review]
pull request: https://github.com/mozilla-b2g/gaia/pull/14563

Code review only, I didn't manually test the patch.
Attachment #8345770 - Flags: review?(timdream) → review+
travis passed:
https://travis-ci.org/mozilla-b2g/gaia/builds/15320294

landed in gaia:
https://github.com/mpizza/gaia/commit/6bf43113848bc1094e57b0d1469742e905acc961
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED

Comment 21

4 years ago
Plus this bug because this is the blocker of committed keyboard OOP feature.
blocking-b2g: 1.4? → 1.4+

Comment 22

4 years ago
Thanks for the help!
Verified this patch.

* Build information:
 - Gaia      5de94a2be6ab8d33434294d70c1de330f55d8f2d
 - Gecko     http://hg.mozilla.org/mozilla-central/rev/c8d5a871ae32
 - BuildID   20140101040201
 - Version   29.0a1

* Result:
  Cannot reproduce the bug
Status: RESOLVED → VERIFIED

Comment 23

4 years ago
Hi, all,

My bad. I didn't hit the root cause while I verified this bug.
So, please ignore my test result (Comment 22) because I still can reproduce this bug.

I suggest to keep following this bug on bug 953027.
Thanks!
Status: VERIFIED → RESOLVED
Last Resolved: 4 years ago4 years ago

Updated

4 years ago
Duplicate of this bug: 953027

Comment 25

4 years ago
Hi, all,

After the patch landed on master, FxOS can successfully re-launch built-in keyboard.
But, FxOS still cannot re-launching the third party keyboard.
I have submitted a bug. (Bug 958003)
Thanks!

* Verification Build:
 - Gaia      b7a7191f761933fd4878227488c75d09f5ba890c
 - Gecko     http://hg.mozilla.org/mozilla-central/rev/cf2d1bd796ea
 - BuildID   20140108040200
 - Version   29.0a1

* Test Result:
 - FxOS can successfully re-launch built-in keyboard.
Status: RESOLVED → VERIFIED
status-b2g-v1.4: --- → fixed
Target Milestone: --- → 1.3 C2/1.4 S2(17jan)
You need to log in before you can comment on or make changes to this bug.