Bug 767354 - Typing 1 character in password fields will insert 2 characters. r=cpeterson a=mfinkle
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 09 Jul 2012 13:03:38 -0700
changeset 98357 6e760e2a01a9d8daaa84d83fcd975affb7bb2b56
parent 98356 73be8c95dd66b459e7785f8103e83da28c234647
child 98358 3f11aed80c16eccbe471a2df640362594b3aa324
push id1651
push usercpeterson@mozilla.com
push dateMon, 09 Jul 2012 20:20:00 +0000
treeherdermozilla-aurora@6e760e2a01a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson, mfinkle
bugs767354
milestone15.0a2
Bug 767354 - Typing 1 character in password fields will insert 2 characters. r=cpeterson a=mfinkle
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -465,24 +465,26 @@ public class GeckoInputConnection
         return true;
     }
 
     private static InputMethodManager getInputMethodManager() {
         Context context = GeckoApp.mAppContext.getLayerController().getView().getContext();
         return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
     }
 
-    public void notifyTextChange(InputMethodManager imm, String text,
-                                 int start, int oldEnd, int newEnd) {
+    protected void notifyTextChange(InputMethodManager imm, String text,
+                                    int start, int oldEnd, int newEnd) {
         if (!mBatchMode) {
             if (!text.contentEquals(mEditable)) {
                 if (DEBUG) Log.d(LOGTAG, String.format(
                                  ". . . notifyTextChange: current mEditable=\"%s\"",
                                  mEditable.toString()));
-                setEditable(text);
+                // Editable will be updated by IME event
+                if (!hasCompositionString())
+                    setEditable(text);
             }
         }
 
         if (mUpdateRequest == null)
             return;
 
         View v = GeckoApp.mAppContext.getLayerController().getView();