As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 726393 - crash [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConnection.processKeyDown( ]
: crash [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConne...
: crash
Product: Firefox for Android
Classification: Client Software
Component: Keyboards and IME (show other bugs)
: 12 Branch
: ARM Android
: P1 critical (vote)
: Firefox 14
Assigned To: Chris Peterson [:cpeterson]
: Jim Chen [:jchen] [:darchons]
Depends on:
Blocks: 731034
  Show dependency treegraph
Reported: 2012-02-11 20:17 PST by Naoki Hirata :nhirata (please use needinfo instead of cc)
Modified: 2012-06-06 00:53 PDT (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

bug-726393-null-keylistener.patch (4.62 KB, patch)
2012-03-12 16:04 PDT, Chris Peterson [:cpeterson]
blassey.bugs: review+
gbrown: feedback+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description User image Naoki Hirata :nhirata (please use needinfo instead of cc) 2012-02-11 20:17:04 PST
Occurs on build : 	20120208042017
on : Product: 'GT-N7000', Manufacturer: 'samsung'

This bug was filed from the Socorro interface and is 
report bp-290df2c8-62a6-4999-a3fb-37c5d2120209 .
	at org.mozilla.gecko.GeckoInputConnection.processKeyDown(
	at org.mozilla.gecko.GeckoInputConnection.onKeyPreIme(
	at org.mozilla.gecko.gfx.LayerView.onKeyPreIme(
	at android.view.View.dispatchKeyEventPreIme(
	at android.view.ViewGroup.dispatchKeyEventPreIme(
	at android.view.ViewGroup.dispatchKeyEventPreIme(
	at android.view.ViewGroup.dispatchKeyEventPreIme(
	at android.view.ViewGroup.dispatchKeyEventPreIme(
	at android.view.ViewRoot.deliverKeyEvent(
	at android.view.ViewRoot.handleMessage(
	at android.os.Handler.dispatchMessage(
	at android.os.Looper.loop(
	at org.mozilla.gecko.GeckoApp$
	at android.os.Handler.handleCallback(
	at android.os.Handler.dispatchMessage(
	at android.os.Looper.loop(
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(
	at dalvik.system.NativeStart.main(Native Method)
Comment 1 User image Naoki Hirata :nhirata (please use needinfo instead of cc) 2012-02-27 12:33:40 PST
Java crash; nom-ing for blocking fennec
Comment 2 User image Kevin Brosnan [:kbrosnan] 2012-03-04 13:51:42 PST
Not a top crash, not blocking. Still good to fix though.
Comment 3 User image Geoff Brown [:gbrown] 2012-03-09 16:30:15 PST
It looks to me like the offending code is:

        if (mIMEState == IME_STATE_DISABLED ||
                keyCode == KeyEvent.KEYCODE_ENTER ||
                keyCode == KeyEvent.KEYCODE_DEL ||
                keyCode == KeyEvent.KEYCODE_TAB ||
                (event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) != 0 ||
                !mKeyListener.onKeyDown(v, mEditable, keyCode, event)) {

suggesting that either event == null or mKeyListener == null.

If event == null, there should have been a NullPointerException at:

    public boolean onKeyPreIme(int keyCode, KeyEvent event) {
        switch (event.getAction()) {
Since that didn't happen, I would conclude that mKeyListener == null. 

Normally mKeyListener would be set in onCreateInputConnection. Maybe it is possible for onKeyPreIme to be called before onCreateInputConnection?
Comment 4 User image Chris Peterson [:cpeterson] 2012-03-12 16:04:01 PDT
Created attachment 605195 [details] [diff] [review]

Fetch Android's cached TextKeyListener on key down/up events to avoid nulls.
Comment 5 User image Ryan VanderMeulen [:RyanVM] 2012-03-14 15:04:55 PDT
Comment 6 User image Marco Bonardo [::mak] 2012-03-15 08:19:21 PDT
Comment 7 User image Chris Peterson [:cpeterson] 2012-03-19 12:17:48 PDT
Comment on attachment 605195 [details] [diff] [review]

[Approval Request Comment]
Regression caused by (bug #): N/A
User impact if declined: Keyboard crash
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): Android Java only.
String changes made by this patch: N/A
Comment 8 User image Alex Keybl [:akeybl] 2012-03-20 13:04:26 PDT
Comment on attachment 605195 [details] [diff] [review]

[Triage Comment]
Mobile only - approved for Aurora 13.
Comment 9 User image Chris Peterson [:cpeterson] 2012-03-20 14:19:20 PDT
checkin-needed for mozilla-aurora
Comment 10 User image Mark Finkle (:mfinkle) (use needinfo?) 2012-03-24 09:17:30 PDT
Comment 11 User image Paul Feher 2012-06-06 00:53:39 PDT
I'm setting this as verified/fixed since it wasn't reported for the last 4 weeks.

Note You need to log in before you can comment on or make changes to this bug.