aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-06 06:33:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-06 06:34:00 +0000
commiteb771b9dc4300e907fb5cdb256aedd3f174f0de2 (patch)
tree72b638ce6ca2d2cb1be69a87cfed67b3136a45dc /java/src
parent3ca65c8fd56724a7b4b3440bccf613e5a1a17513 (diff)
parentc69ba5630dcc8fd2542d0199ff703df027f50ba8 (diff)
downloadlatinime-eb771b9dc4300e907fb5cdb256aedd3f174f0de2.tar.gz
latinime-eb771b9dc4300e907fb5cdb256aedd3f174f0de2.tar.xz
latinime-eb771b9dc4300e907fb5cdb256aedd3f174f0de2.zip
Merge "Fix a small bug with rotation."
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 4e12a0a31..0dccba09c 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -644,7 +644,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final SettingsValues settingsValues = mSettings.getCurrent();
if (settingsValues.mDisplayOrientation != conf.orientation) {
mHandler.startOrientationChanging();
- mInputLogic.finishInput();
+ // If !isComposingWord, #commitTyped() is a no-op, but still, it's better to avoid
+ // the useless IPC of {begin,end}BatchEdit.
+ if (mInputLogic.mWordComposer.isComposingWord()) {
+ mInputLogic.mConnection.beginBatchEdit();
+ // If we had a composition in progress, we need to commit the word so that the
+ // suggestionsSpan will be added. This will allow resuming on the same suggestions
+ // after rotation is finished.
+ mInputLogic.commitTyped(mSettings.getCurrent(), LastComposedWord.NOT_A_SEPARATOR);
+ mInputLogic.mConnection.endBatchEdit();
+ }
}
PersonalizationDictionarySessionRegistrar.onConfigurationChanged(this, conf,
mDictionaryFacilitator);