am 75ec579e: Merge "[IL81] Remove a useless test."

* commit '75ec579e07ccb598970bc800db2d9f2dac11ec7a':
  [IL81] Remove a useless test.
main
Jean Chalard 2014-01-27 02:13:35 -08:00 committed by Android Git Automerger
commit 0256b15d3a
1 changed files with 3 additions and 12 deletions

View File

@ -206,18 +206,9 @@ public final class InputLogic {
// state-related special processing to kick in. // state-related special processing to kick in.
mSpaceState = SpaceState.NONE; mSpaceState = SpaceState.NONE;
// if composingSpanStart and composingSpanEnd are -1, it means there is no composing final boolean selectionChangedOrSafeToReset =
// span in the view - we can use that to narrow down whether the cursor was moved oldSelStart != newSelStart || oldSelEnd != newSelEnd // selection changed
// by us or not. If we are composing a word but there is no composing span, then || !mWordComposer.isComposingWord(); // safe to reset
// we know for sure the cursor moved while we were composing and we should reset
// the state. TODO: rescind this policy: the framework never removes the composing
// span on its own accord while editing. This test is useless.
final boolean noComposingSpan = composingSpanStart == -1 && composingSpanEnd == -1;
final boolean selectionChanged = oldSelStart != newSelStart || oldSelEnd != newSelEnd;
// TODO: is it still necessary to test for composingSpan related stuff?
final boolean selectionChangedOrSafeToReset = selectionChanged
|| (!mWordComposer.isComposingWord()) || noComposingSpan;
final boolean hasOrHadSelection = (oldSelStart != oldSelEnd || newSelStart != newSelEnd); final boolean hasOrHadSelection = (oldSelStart != oldSelEnd || newSelStart != newSelEnd);
final int moveAmount = newSelStart - oldSelStart; final int moveAmount = newSelStart - oldSelStart;
if (selectionChangedOrSafeToReset && (hasOrHadSelection if (selectionChangedOrSafeToReset && (hasOrHadSelection