Android's InputMethodManager calls GeckoInputConnection.finishComposingText() on the wrong thread when dismissing "Add Search Engine" dialog

RESOLVED FIXED in Firefox 18

Status

()

P4
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

Trunk
Firefox 18
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox17 wontfix, firefox18 fixed)

Details

(Assignee)

Description

6 years ago
STR:
1. Compile a local build with GeckoInputConnection.DEBUG = true;
2. Load a page with a text form
3. Long-press the text form and select "Add Search Engine" from the popup menu
4. Dismiss the "Add Search Engine" dialog
5. Watch logcat

AR:
Big warning about android.view.inputmethod.InputMethodManager.checkFocus() calling GeckoInputConnection.finishComposingText() on Gecko's background thread, not the UI thread! This is a corner cause because Android calls finishComposingText() from the UI thread when actually editing text.


E/GeckoAppShell(10895): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 10 ("GeckoBackgroundThread")
E/GeckoAppShell(10895): java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 10 ("GeckoBackgroundThread)
E/GeckoAppShell(10895): 	at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java:2995)
E/GeckoAppShell(10895): 	at org.mozilla.gecko.GeckoApp.assertOnUiThread(GeckoApp.java:2982)
E/GeckoAppShell(10895): 	at org.mozilla.gecko.GeckoInputConnection$DebugGeckoInputConnection.finishComposingText(GeckoInputConnection.java:1315)
E/GeckoAppShell(10895): 	at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1183)
E/GeckoAppShell(10895): 	at android.view.inputmethod.InputMethodManager.onWindowFocus(InputMethodManager.java:1215)
E/GeckoAppShell(10895): 	at android.view.ViewRoot.handleMessage(ViewRoot.java:2115)
E/GeckoAppShell(10895): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/GeckoAppShell(10895): 	at android.os.Looper.loop(Looper.java:130)
E/GeckoAppShell(10895): 	at org.mozilla.gecko.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)
(Assignee)

Updated

6 years ago
Depends on: 730330
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

6 years ago
status-firefox17: --- → wontfix
Target Milestone: --- → Firefox 18
(Assignee)

Comment 2

6 years ago
Fix landed as per bug 730330 comment 62
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.