am 296adf57: Merge "Change a heuristic and add a log."

* commit '296adf5710fed09eb0b5e038ef2ce6f55914c8f6':
  Change a heuristic and add a log.
main
Jean Chalard 2014-02-21 04:00:15 -08:00 committed by Android Git Automerger
commit 8f7aca42ac
2 changed files with 5 additions and 3 deletions

View File

@ -750,6 +750,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
+ ", word caps = "
+ ((editorInfo.inputType & InputType.TYPE_TEXT_FLAG_CAP_WORDS) != 0));
}
Log.i(TAG, "Starting input. Cursor position = "
+ editorInfo.initialSelStart + "," + editorInfo.initialSelEnd);
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
ResearchLogger.latinIME_onStartInputViewInternal(editorInfo, prefs);

View File

@ -847,9 +847,9 @@ public final class RichInputConnection {
mExpectedSelStart = mExpectedSelEnd = Constants.NOT_A_CURSOR_POSITION;
} else {
final int textLength = textBeforeCursor.length();
if (textLength > mExpectedSelStart
|| (textLength < Constants.EDITOR_CONTENTS_CACHE_SIZE
&& mExpectedSelStart < Constants.EDITOR_CONTENTS_CACHE_SIZE)) {
if (textLength < Constants.EDITOR_CONTENTS_CACHE_SIZE
&& (textLength > mExpectedSelStart
|| mExpectedSelStart < Constants.EDITOR_CONTENTS_CACHE_SIZE)) {
// It should not be possible to have only one of those variables be
// NOT_A_CURSOR_POSITION, so if they are equal, either the selection is zero-sized
// (simple cursor, no selection) or there is no cursor/we don't know its pos