Bug 821979 - Specify valid selection offsets in onCreateInputConnection; r=blassey
authorJim Chen <nchen@mozilla.com>
Wed, 26 Dec 2012 10:06:53 -0500
changeset 126148 7d531752a0fb293d9c40ab40f6d7b2a698c0fb55
parent 126147 d7b8336e01d12f4014f21af7afbdf50260f39cdc
child 126149 d6c5a0ec5757e489ef9417bdb5c98bf1fb2ab305
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs821979
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 821979 - Specify valid selection offsets in onCreateInputConnection; r=blassey
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -355,19 +355,19 @@ class GeckoInputConnection
         // If the user has changed IMEs, then notify input method observers.
         if (mCurrentInputMethod != prevInputMethod) {
             FormAssistPopup popup = app.mFormAssistPopup;
             if (popup != null) {
                 popup.onInputMethodChanged(mCurrentInputMethod);
             }
         }
 
-        // We don't know the selection
-        outAttrs.initialSelStart = -1;
-        outAttrs.initialSelEnd = -1;
+        Editable editable = getEditable();
+        outAttrs.initialSelStart = Selection.getSelectionStart(editable);
+        outAttrs.initialSelEnd = Selection.getSelectionEnd(editable);
         return this;
     }
 
     public boolean onKeyPreIme(int keyCode, KeyEvent event) {
         return false;
     }
 
     public boolean onKeyDown(int keyCode, KeyEvent event) {