diff options
author | Marco Nelissen <marcone@google.com> | 2009-05-14 15:11:23 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2009-05-14 15:11:23 -0700 |
commit | 9ea923174c2daffd9b6a1cd630018d3fdfe91f62 (patch) | |
tree | 1060128ff8448d5ac3d15cefad71b5dcb58724d7 /core | |
parent | 94f70cbbe29c3aca748df9d543c366d838f6598b (diff) | |
download | frameworks_base-9ea923174c2daffd9b6a1cd630018d3fdfe91f62.zip frameworks_base-9ea923174c2daffd9b6a1cd630018d3fdfe91f62.tar.gz frameworks_base-9ea923174c2daffd9b6a1cd630018d3fdfe91f62.tar.bz2 |
Rearrange some code so it makes more sense. Thanks, findbugs.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/TextView.java | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index c6b0187..adfc74f 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -4434,29 +4434,31 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener boolean reportExtractedText() { final InputMethodState ims = mInputMethodState; - final boolean contentChanged = ims.mContentChanged; - if (ims != null && (contentChanged || ims.mSelectionModeChanged)) { - ims.mContentChanged = false; - ims.mSelectionModeChanged = false; - final ExtractedTextRequest req = mInputMethodState.mExtracting; - if (req != null) { - InputMethodManager imm = InputMethodManager.peekInstance(); - if (imm != null) { - if (DEBUG_EXTRACT) Log.v(TAG, "Retrieving extracted start=" - + ims.mChangedStart + " end=" + ims.mChangedEnd - + " delta=" + ims.mChangedDelta); - if (ims.mChangedStart < 0 && !contentChanged) { - ims.mChangedStart = EXTRACT_NOTHING; - } - if (extractTextInternal(req, ims.mChangedStart, ims.mChangedEnd, - ims.mChangedDelta, ims.mTmpExtracted)) { - if (DEBUG_EXTRACT) Log.v(TAG, "Reporting extracted start=" - + ims.mTmpExtracted.partialStartOffset - + " end=" + ims.mTmpExtracted.partialEndOffset - + ": " + ims.mTmpExtracted.text); - imm.updateExtractedText(this, req.token, - mInputMethodState.mTmpExtracted); - return true; + if (ims != null) { + final boolean contentChanged = ims.mContentChanged; + if (contentChanged || ims.mSelectionModeChanged) { + ims.mContentChanged = false; + ims.mSelectionModeChanged = false; + final ExtractedTextRequest req = mInputMethodState.mExtracting; + if (req != null) { + InputMethodManager imm = InputMethodManager.peekInstance(); + if (imm != null) { + if (DEBUG_EXTRACT) Log.v(TAG, "Retrieving extracted start=" + + ims.mChangedStart + " end=" + ims.mChangedEnd + + " delta=" + ims.mChangedDelta); + if (ims.mChangedStart < 0 && !contentChanged) { + ims.mChangedStart = EXTRACT_NOTHING; + } + if (extractTextInternal(req, ims.mChangedStart, ims.mChangedEnd, + ims.mChangedDelta, ims.mTmpExtracted)) { + if (DEBUG_EXTRACT) Log.v(TAG, "Reporting extracted start=" + + ims.mTmpExtracted.partialStartOffset + + " end=" + ims.mTmpExtracted.partialEndOffset + + ": " + ims.mTmpExtracted.text); + imm.updateExtractedText(this, req.token, + mInputMethodState.mTmpExtracted); + return true; + } } } } |