aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-06 13:11:03 +0900
committerJean Chalard <jchalard@google.com>2014-06-06 14:06:29 +0900
commitc69ba5630dcc8fd2542d0199ff703df027f50ba8 (patch)
tree731fe2d37208767ddba54fb48aa0d9908b5d406d /java/src
parentb7206b6bcaf73640dd25b00898f5edd1b3edb762 (diff)
downloadlatinime-c69ba5630dcc8fd2542d0199ff703df027f50ba8.tar.gz
latinime-c69ba5630dcc8fd2542d0199ff703df027f50ba8.tar.xz
latinime-c69ba5630dcc8fd2542d0199ff703df027f50ba8.zip
Fix a small bug with rotation.
Bug: 2349475 Change-Id: Id4aa5ce56b1a545e4cb88ca1b01cf24642deade2
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 deaf6cdf4..84178676f 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -643,7 +643,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);