aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-20 15:00:44 +0900
committerJean Chalard <jchalard@google.com>2013-12-20 16:48:54 +0900
commit1404c1af850236da4fe4ed3825b70cb228a1da5b (patch)
treeb8438b4413cd8ce277f49ce57b8db832834d9a87 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parent8a390023e122e517faca85ed7161c7b67071be93 (diff)
downloadlatinime-1404c1af850236da4fe4ed3825b70cb228a1da5b.tar.gz
latinime-1404c1af850236da4fe4ed3825b70cb228a1da5b.tar.xz
latinime-1404c1af850236da4fe4ed3825b70cb228a1da5b.zip
[IL21] Move the workaround utils to a better place.
Bug: 8636060 Change-Id: I566f9e109ebcabe3a6a778118434ce79d02d1113
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index db27d22b7..db9bf348f 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -387,7 +387,7 @@ public final class InputLogic {
final boolean swapWeakSpace = maybeStripSpace(settingsValues,
codePoint, spaceState, Constants.SUGGESTION_STRIP_COORDINATE == x);
- sendKeyCodePoint(codePoint);
+ sendKeyCodePoint(settingsValues, codePoint);
if (swapWeakSpace) {
swapSwapperAndSpace(keyboardSwitcher);
@@ -449,7 +449,7 @@ public final class InputLogic {
}
if (!shouldAvoidSendingCode) {
- sendKeyCodePoint(codePoint);
+ sendKeyCodePoint(settingsValues, codePoint);
}
if (Constants.CODE_SPACE == codePoint) {
@@ -593,7 +593,7 @@ public final class InputLogic {
// This should never happen.
Log.e(TAG, "Backspace when we don't know the selection position");
}
- if (mLatinIME.mAppWorkAroundsUtils.isBeforeJellyBean() ||
+ if (settingsValues.isBeforeJellyBean() ||
settingsValues.mInputAttributes.isTypeNull()) {
// There are two possible reasons to send a key event: either the field has
// type TYPE_NULL, in which case the keyboard should send events, or we are
@@ -1167,9 +1167,10 @@ public final class InputLogic {
* Normally we send code points with commitText, but there are some cases (where backward
* compatibility is a concern for example) where we want to use deprecated methods.
*
+ * @param settingsValues the current values of the settings.
* @param codePoint the code point to send.
*/
- private void sendKeyCodePoint(final int codePoint) {
+ private void sendKeyCodePoint(final SettingsValues settingsValues, final int codePoint) {
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.latinIME_sendKeyCodePoint(codePoint);
}
@@ -1181,8 +1182,7 @@ public final class InputLogic {
}
// TODO: we should do this also when the editor has TYPE_NULL
- if (Constants.CODE_ENTER == codePoint
- && mLatinIME.mAppWorkAroundsUtils.isBeforeJellyBean()) {
+ if (Constants.CODE_ENTER == codePoint && settingsValues.isBeforeJellyBean()) {
// Backward compatibility mode. Before Jelly bean, the keyboard would simulate
// a hardware keyboard event on pressing enter or delete. This is bad for many
// reasons (there are race conditions with commits) but some applications are
@@ -1209,7 +1209,7 @@ public final class InputLogic {
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.latinIME_promotePhantomSpace();
}
- sendKeyCodePoint(Constants.CODE_SPACE);
+ sendKeyCodePoint(settingsValues, Constants.CODE_SPACE);
}
}