am eb771b9d: Merge "Fix a small bug with rotation."

* commit 'eb771b9dc4300e907fb5cdb256aedd3f174f0de2':
  Fix a small bug with rotation.
main
Jean Chalard 2014-06-06 06:36:12 +00:00 committed by Android Git Automerger
commit 46a705f250
1 changed files with 10 additions and 1 deletions

View File

@ -644,7 +644,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final SettingsValues settingsValues = mSettings.getCurrent(); final SettingsValues settingsValues = mSettings.getCurrent();
if (settingsValues.mDisplayOrientation != conf.orientation) { if (settingsValues.mDisplayOrientation != conf.orientation) {
mHandler.startOrientationChanging(); 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, PersonalizationDictionarySessionRegistrar.onConfigurationChanged(this, conf,
mDictionaryFacilitator); mDictionaryFacilitator);