am 86db54df: am 137203d4: am 574b80aa: Remove debug prints.

* commit '86db54df74b821a15f7a3081c3737f8a63f91214':
  Remove debug prints.
main
Jean Chalard 2012-10-01 13:46:16 -07:00 committed by Android Git Automerger
commit 37688ae8c1
2 changed files with 17 additions and 12 deletions

View File

@ -1878,6 +1878,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator; mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator;
final CharSequence textWithUnderline = final CharSequence textWithUnderline =
getTextWithUnderline(mWordComposer.getTypedWord()); getTextWithUnderline(mWordComposer.getTypedWord());
// TODO: when called from an updateSuggestionStrip() call that results from a posted
// message, this is called outside any batch edit. Potentially, this may result in some
// janky flickering of the screen, although the display speed makes it unlikely in
// the practice.
mConnection.setComposingText(textWithUnderline, 1); mConnection.setComposingText(textWithUnderline, 1);
} }
} }

View File

@ -45,6 +45,7 @@ public final class RichInputConnection {
private static final String TAG = RichInputConnection.class.getSimpleName(); private static final String TAG = RichInputConnection.class.getSimpleName();
private static final boolean DBG = false; private static final boolean DBG = false;
private static final boolean DEBUG_PREVIOUS_TEXT = false; private static final boolean DEBUG_PREVIOUS_TEXT = false;
private static final boolean DEBUG_BATCH_NESTING = false;
// Provision for a long word pair and a separator // Provision for a long word pair and a separator
private static final int LOOKBACK_CHARACTER_NUM = BinaryDictionary.MAX_WORD_LENGTH * 2 + 1; private static final int LOOKBACK_CHARACTER_NUM = BinaryDictionary.MAX_WORD_LENGTH * 2 + 1;
private static final Pattern spaceRegex = Pattern.compile("\\s+"); private static final Pattern spaceRegex = Pattern.compile("\\s+");
@ -128,7 +129,7 @@ public final class RichInputConnection {
Log.e(TAG, "Nest level too deep : " + mNestLevel); Log.e(TAG, "Nest level too deep : " + mNestLevel);
} }
} }
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
} }
@ -163,7 +164,7 @@ public final class RichInputConnection {
} }
public void finishComposingText() { public void finishComposingText() {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
mCommittedTextBeforeComposingText.append(mComposingText); mCommittedTextBeforeComposingText.append(mComposingText);
mCurrentCursorPosition += mComposingText.length(); mCurrentCursorPosition += mComposingText.length();
@ -177,7 +178,7 @@ public final class RichInputConnection {
} }
public void commitText(final CharSequence text, final int i) { public void commitText(final CharSequence text, final int i) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
mCommittedTextBeforeComposingText.append(text); mCommittedTextBeforeComposingText.append(text);
mCurrentCursorPosition += text.length() - mComposingText.length(); mCurrentCursorPosition += text.length() - mComposingText.length();
@ -247,7 +248,7 @@ public final class RichInputConnection {
} }
public void deleteSurroundingText(final int i, final int j) { public void deleteSurroundingText(final int i, final int j) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
final int remainingChars = mComposingText.length() - i; final int remainingChars = mComposingText.length() - i;
if (remainingChars >= 0) { if (remainingChars >= 0) {
mComposingText.setLength(remainingChars); mComposingText.setLength(remainingChars);
@ -283,7 +284,7 @@ public final class RichInputConnection {
} }
public void sendKeyEvent(final KeyEvent keyEvent) { public void sendKeyEvent(final KeyEvent keyEvent) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) { if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) {
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
// This method is only called for enter or backspace when speaking to old // This method is only called for enter or backspace when speaking to old
@ -331,7 +332,7 @@ public final class RichInputConnection {
} }
public void setComposingText(final CharSequence text, final int i) { public void setComposingText(final CharSequence text, final int i) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
mCurrentCursorPosition += text.length() - mComposingText.length(); mCurrentCursorPosition += text.length() - mComposingText.length();
mComposingText.setLength(0); mComposingText.setLength(0);
@ -347,7 +348,7 @@ public final class RichInputConnection {
} }
public void setSelection(final int from, final int to) { public void setSelection(final int from, final int to) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
if (null != mIC) { if (null != mIC) {
mIC.setSelection(from, to); mIC.setSelection(from, to);
@ -361,7 +362,7 @@ public final class RichInputConnection {
} }
public void commitCorrection(final CorrectionInfo correctionInfo) { public void commitCorrection(final CorrectionInfo correctionInfo) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
// This has no effect on the text field and does not change its content. It only makes // This has no effect on the text field and does not change its content. It only makes
// TextView flash the text for a second based on indices contained in the argument. // TextView flash the text for a second based on indices contained in the argument.
@ -375,7 +376,7 @@ public final class RichInputConnection {
} }
public void commitCompletion(final CompletionInfo completionInfo) { public void commitCompletion(final CompletionInfo completionInfo) {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug(); if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
final CharSequence text = completionInfo.getText(); final CharSequence text = completionInfo.getText();
mCommittedTextBeforeComposingText.append(text); mCommittedTextBeforeComposingText.append(text);
@ -575,7 +576,7 @@ public final class RichInputConnection {
} }
public void removeTrailingSpace() { public void removeTrailingSpace() {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
final CharSequence lastOne = getTextBeforeCursor(1, 0); final CharSequence lastOne = getTextBeforeCursor(1, 0);
if (lastOne != null && lastOne.length() == 1 if (lastOne != null && lastOne.length() == 1
&& lastOne.charAt(0) == Keyboard.CODE_SPACE) { && lastOne.charAt(0) == Keyboard.CODE_SPACE) {
@ -631,7 +632,7 @@ public final class RichInputConnection {
} }
public boolean revertDoubleSpace() { public boolean revertDoubleSpace() {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
// Here we test whether we indeed have a period and a space before us. This should not // Here we test whether we indeed have a period and a space before us. This should not
// be needed, but it's there just in case something went wrong. // be needed, but it's there just in case something went wrong.
final CharSequence textBeforeCursor = getTextBeforeCursor(2, 0); final CharSequence textBeforeCursor = getTextBeforeCursor(2, 0);
@ -649,7 +650,7 @@ public final class RichInputConnection {
} }
public boolean revertSwapPunctuation() { public boolean revertSwapPunctuation() {
checkBatchEdit(); if (DEBUG_BATCH_NESTING) checkBatchEdit();
// Here we test whether we indeed have a space and something else before us. This should not // Here we test whether we indeed have a space and something else before us. This should not
// be needed, but it's there just in case something went wrong. // be needed, but it's there just in case something went wrong.
final CharSequence textBeforeCursor = getTextBeforeCursor(2, 0); final CharSequence textBeforeCursor = getTextBeforeCursor(2, 0);