aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-06 06:36:12 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-06 06:36:12 +0000
commit46a705f250aee105c218e31c5100609517c52eb4 (patch)
tree72b638ce6ca2d2cb1be69a87cfed67b3136a45dc /java
parent2164a4126bc747575a5106067d2e6f10fa373f1b (diff)
parenteb771b9dc4300e907fb5cdb256aedd3f174f0de2 (diff)
downloadlatinime-46a705f250aee105c218e31c5100609517c52eb4.tar.gz
latinime-46a705f250aee105c218e31c5100609517c52eb4.tar.xz
latinime-46a705f250aee105c218e31c5100609517c52eb4.zip
am eb771b9d: Merge "Fix a small bug with rotation."
* commit 'eb771b9dc4300e907fb5cdb256aedd3f174f0de2': Fix a small bug with rotation.
Diffstat (limited to 'java')
-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);