Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / public / android / java / src / org / chromium / content / browser / input / AdapterInputConnection.java
index dcc08fa..6595808 100644 (file)
@@ -101,7 +101,8 @@ public class AdapterInputConnection extends BaseInputConnection {
         } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeNumber) {
             // Number
             outAttrs.inputType = InputType.TYPE_CLASS_NUMBER
-                    | InputType.TYPE_NUMBER_VARIATION_NORMAL;
+                    | InputType.TYPE_NUMBER_VARIATION_NORMAL
+                    | InputType.TYPE_NUMBER_FLAG_DECIMAL;
             outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
         }
         outAttrs.initialSelStart = Selection.getSelectionStart(mEditable);
@@ -128,16 +129,18 @@ public class AdapterInputConnection extends BaseInputConnection {
      *                         composition.
      * @param compositionEnd The character offset of the composition end, or -1 if there is no
      *                       selection.
-     * @param requireAck True when the update was not caused by IME, false otherwise.
+     * @param isNonImeChange True when the update was caused by non-IME (e.g. Javascript).
      */
     @VisibleForTesting
     public void updateState(String text, int selectionStart, int selectionEnd, int compositionStart,
-            int compositionEnd, boolean requireAck) {
+            int compositionEnd, boolean isNonImeChange) {
         if (DEBUG) {
             Log.w(TAG, "updateState [" + text + "] [" + selectionStart + " " + selectionEnd + "] ["
-                    + compositionStart + " " + compositionEnd + "] [" + requireAck + "]");
+                    + compositionStart + " " + compositionEnd + "] [" + isNonImeChange + "]");
         }
-        if (!requireAck) return;
+        // If this update is from the IME, no further state modification is necessary because the
+        // state should have been updated already by the IM framework directly.
+        if (!isNonImeChange) return;
 
         // Non-breaking spaces can cause the IME to get confused. Replace with normal spaces.
         text = text.replace('\u00A0', ' ');