aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-11-18 15:32:21 +0900
committerJean Chalard <jchalard@google.com>2014-11-19 19:22:04 +0900
commit9444d70514cfa11e88380e653bea3b4a6c205151 (patch)
tree4d83d36443c372e09ef7a4085fdaf01efce2812e /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parentfdf92789c12ff0cba6130d3ca6848463417e3965 (diff)
downloadlatinime-9444d70514cfa11e88380e653bea3b4a6c205151.tar.gz
latinime-9444d70514cfa11e88380e653bea3b4a6c205151.tar.xz
latinime-9444d70514cfa11e88380e653bea3b4a6c205151.zip
Fix oscillations on ICS
Bug: 18181427 Change-Id: Ib4dd62037b1f7b2d10496ee3e45b4a138e29f90a
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, 9 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index bafea178e..f74e9b5f5 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -1176,14 +1176,13 @@ public final class InputLogic {
StatsUtils.onBackspacePressed(totalDeletedLength);
}
}
- if (inputTransaction.mSettingsValues
- .isSuggestionsEnabledPerUserSettings()
+ if (inputTransaction.mSettingsValues.isSuggestionsEnabledPerUserSettings()
&& inputTransaction.mSettingsValues.mSpacingAndPunctuations
.mCurrentLanguageHasSpaces
&& !mConnection.isCursorFollowedByWordCharacter(
inputTransaction.mSettingsValues.mSpacingAndPunctuations)) {
restartSuggestionsOnWordTouchedByCursor(inputTransaction.mSettingsValues,
- currentKeyboardScriptId);
+ false /* forStartInput */, currentKeyboardScriptId);
}
}
}
@@ -1439,10 +1438,13 @@ public final class InputLogic {
* do nothing.
*
* @param settingsValues the current values of the settings.
- * suggestions in the suggestion list.
+ * @param forStartInput whether we're doing this in answer to starting the input (as opposed
+ * to a cursor move, for example). In ICS, there is a platform bug that we need to work
+ * around only when we come here at input start time.
*/
// TODO: make this private.
public void restartSuggestionsOnWordTouchedByCursor(final SettingsValues settingsValues,
+ final boolean forStartInput,
// TODO: remove this argument, put it into settingsValues
final int currentKeyboardScriptId) {
// HACK: We may want to special-case some apps that exhibit bad behavior in case of
@@ -1518,7 +1520,9 @@ public final class InputLogic {
mLatinIME.getCoordinatesForCurrentKeyboard(codePoints));
mWordComposer.setCursorPositionWithinWord(
typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor));
- mConnection.maybeMoveTheCursorAroundAndRestoreToWorkaroundABug();
+ if (forStartInput) {
+ mConnection.maybeMoveTheCursorAroundAndRestoreToWorkaroundABug();
+ }
mConnection.setComposingRegion(expectedCursorPosition - numberOfCharsInWordBeforeCursor,
expectedCursorPosition + range.getNumberOfCharsInWordAfterCursor());
if (suggestions.size() <= 1) {