From 06993cb0197c0b3f1f06b367d57e15c6be8b20f4 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Fri, 16 Nov 2012 17:49:22 -0800 Subject: [PATCH 1/2] Revert "Only add spaces automatically when appropriate." This reverts commit 6ce66d1c7d4a5be9c6ed33e4f881994283d5eee9 Change-Id: I90004a5fea0bc7999ecf8742f883ff4dac264d8a bug: 7565414 --- .../inputmethod/latin/InputAttributes.java | 5 ---- .../inputmethod/latin/InputTypeUtils.java | 28 ++++++------------- .../android/inputmethod/latin/LatinIME.java | 4 +-- .../inputmethod/latin/SettingsValues.java | 4 --- 4 files changed, 10 insertions(+), 31 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index ed0aedbc4..2f7608a03 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -65,7 +65,6 @@ public final class InputAttributes { final boolean flagAutoComplete = 0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE); - // TODO: Have a helper method in InputTypeUtils // Make sure that passwords are not displayed in {@link SuggestionStripView}. if (InputTypeUtils.isPasswordInputType(inputType) || InputTypeUtils.isVisiblePasswordInputType(inputType) @@ -162,10 +161,6 @@ public final class InputAttributes { Log.i(TAG, " TYPE_TEXT_FLAG_AUTO_COMPLETE"); } - public boolean shouldInsertSpacesAutomatically() { - return InputTypeUtils.isAutoSpaceFriendlyType(mInputType); - } - // Pretty print @Override public String toString() { diff --git a/java/src/com/android/inputmethod/latin/InputTypeUtils.java b/java/src/com/android/inputmethod/latin/InputTypeUtils.java index f1b413163..500866a13 100644 --- a/java/src/com/android/inputmethod/latin/InputTypeUtils.java +++ b/java/src/com/android/inputmethod/latin/InputTypeUtils.java @@ -29,37 +29,31 @@ public final class InputTypeUtils implements InputType { TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD; private static final int TEXT_VISIBLE_PASSWORD_INPUT_TYPE = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; - private static final int SUPPRESSING_AUTO_SPACES_FIELD_TYPE = - InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS - | InputType.TYPE_TEXT_VARIATION_PASSWORD - | InputType.TYPE_TEXT_VARIATION_URI - | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD - | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD; private InputTypeUtils() { // This utility class is not publicly instantiable. } - private static boolean isWebEditTextInputType(final int inputType) { + private static boolean isWebEditTextInputType(int inputType) { return inputType == (TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_EDIT_TEXT); } - private static boolean isWebPasswordInputType(final int inputType) { + private static boolean isWebPasswordInputType(int inputType) { return WEB_TEXT_PASSWORD_INPUT_TYPE != 0 && inputType == WEB_TEXT_PASSWORD_INPUT_TYPE; } - private static boolean isWebEmailAddressInputType(final int inputType) { + private static boolean isWebEmailAddressInputType(int inputType) { return WEB_TEXT_EMAIL_ADDRESS_INPUT_TYPE != 0 && inputType == WEB_TEXT_EMAIL_ADDRESS_INPUT_TYPE; } - private static boolean isNumberPasswordInputType(final int inputType) { + private static boolean isNumberPasswordInputType(int inputType) { return NUMBER_PASSWORD_INPUT_TYPE != 0 && inputType == NUMBER_PASSWORD_INPUT_TYPE; } - private static boolean isTextPasswordInputType(final int inputType) { + private static boolean isTextPasswordInputType(int inputType) { return inputType == TEXT_PASSWORD_INPUT_TYPE; } @@ -67,12 +61,12 @@ public final class InputTypeUtils implements InputType { return variation == TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS; } - public static boolean isEmailVariation(final int variation) { + public static boolean isEmailVariation(int variation) { return variation == TYPE_TEXT_VARIATION_EMAIL_ADDRESS || isWebEmailAddressVariation(variation); } - public static boolean isWebInputType(final int inputType) { + public static boolean isWebInputType(int inputType) { final int maskedInputType = inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); return isWebEditTextInputType(maskedInputType) || isWebPasswordInputType(maskedInputType) @@ -80,7 +74,7 @@ public final class InputTypeUtils implements InputType { } // Please refer to TextView.isPasswordInputType - public static boolean isPasswordInputType(final int inputType) { + public static boolean isPasswordInputType(int inputType) { final int maskedInputType = inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); return isTextPasswordInputType(maskedInputType) || isWebPasswordInputType(maskedInputType) @@ -88,13 +82,9 @@ public final class InputTypeUtils implements InputType { } // Please refer to TextView.isVisiblePasswordInputType - public static boolean isVisiblePasswordInputType(final int inputType) { + public static boolean isVisiblePasswordInputType(int inputType) { final int maskedInputType = inputType & (TYPE_MASK_CLASS | TYPE_MASK_VARIATION); return maskedInputType == TEXT_VISIBLE_PASSWORD_INPUT_TYPE; } - - public static boolean isAutoSpaceFriendlyType(final int inputType) { - return 0 == (inputType & SUPPRESSING_AUTO_SPACES_FIELD_TYPE); - } } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index f416396e8..ddfc27310 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2257,9 +2257,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // This essentially inserts a space, and that's it. public void promotePhantomSpace() { - if (mCurrentSettings.shouldInsertSpacesAutomatically()) { - sendKeyCodePoint(Keyboard.CODE_SPACE); - } + sendKeyCodePoint(Keyboard.CODE_SPACE); } // Used by the RingCharBuffer diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 6bf37aa92..2a778aa0d 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -271,10 +271,6 @@ public final class SettingsValues { return mPhantomSpacePromotingSymbols.contains(String.valueOf((char)code)); } - public boolean shouldInsertSpacesAutomatically() { - return mInputAttributes.shouldInsertSpacesAutomatically(); - } - private static boolean isAutoCorrectEnabled(final Resources res, final String currentAutoCorrectionSetting) { final String autoCorrectionOff = res.getString( From f5a194b6af12ac4282ee2b00c7db100de77260cc Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Fri, 16 Nov 2012 18:17:10 -0800 Subject: [PATCH 2/2] Revert "Correctly add double quote to the space strippers" This reverts commit af7264abb7abfc0dab08d332b10b9ec8a6b48dc6 Change-Id: I5673103c4a0e9c48df563187d2188ca6e2f15877 bug: 7561815 --- java/res/values-fr/donottranslate.xml | 2 +- java/res/values/donottranslate.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/res/values-fr/donottranslate.xml b/java/res/values-fr/donottranslate.xml index 10feb710f..5288bd7d1 100644 --- a/java/res/values-fr/donottranslate.xml +++ b/java/res/values-fr/donottranslate.xml @@ -21,7 +21,7 @@ .,\")]} - \'\n-/_\" + " \'\n-/_" ;:!?([*&@{<>+=| diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml index f7802a8c8..9e07b2248 100644 --- a/java/res/values/donottranslate.xml +++ b/java/res/values/donottranslate.xml @@ -23,7 +23,7 @@ .,;:!?)]}\" - \n/_\'-\"@ + " \n/_\'-"@ ([*&{<>+=|