diff options
author | 2012-12-04 18:29:25 +0900 | |
---|---|---|
committer | 2012-12-04 18:29:25 +0900 | |
commit | 3709da91a55a1fd86cb9ba98cf7635a58a492da7 (patch) | |
tree | 2a38cfcf45137153d2a5e818ddd9929697ab9484 /java/src/com/android/inputmethod/research/ResearchLogger.java | |
parent | 27da749a2762ae586c080913e0111f23061ea802 (diff) | |
parent | b4a9a6debae5428d243d20d127268b4ffa94a1af (diff) | |
download | latinime-3709da91a55a1fd86cb9ba98cf7635a58a492da7.tar.gz latinime-3709da91a55a1fd86cb9ba98cf7635a58a492da7.tar.xz latinime-3709da91a55a1fd86cb9ba98cf7635a58a492da7.zip |
Merge remote-tracking branch 'goog/master' into mergescriptpackage
Diffstat (limited to 'java/src/com/android/inputmethod/research/ResearchLogger.java')
-rw-r--r-- | java/src/com/android/inputmethod/research/ResearchLogger.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index fe31039e3..3443b7a7a 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -925,18 +925,20 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang public static void latinIME_onWindowHidden(final int savedSelectionStart, final int savedSelectionEnd, final InputConnection ic) { if (ic != null) { - // Capture the TextView contents. This will trigger onUpdateSelection(), so we - // set sLatinIMEExpectingUpdateSelection so that when onUpdateSelection() is called, - // it can tell that it was generated by the logging code, and not by the user, and - // therefore keep user-visible state as is. - ic.beginBatchEdit(); - ic.performContextMenuAction(android.R.id.selectAll); - CharSequence charSequence = ic.getSelectedText(0); - ic.setSelection(savedSelectionStart, savedSelectionEnd); - ic.endBatchEdit(); - sLatinIMEExpectingUpdateSelection = true; final Object[] values = new Object[2]; if (OUTPUT_ENTIRE_BUFFER) { + // Capture the TextView contents. This will trigger onUpdateSelection(), so we + // set sLatinIMEExpectingUpdateSelection so that when onUpdateSelection() is called, + // it can tell that it was generated by the logging code, and not by the user, and + // therefore keep user-visible state as is. + ic.beginBatchEdit(); + ic.performContextMenuAction(android.R.id.selectAll); + CharSequence charSequence = ic.getSelectedText(0); + if (savedSelectionStart != -1 && savedSelectionEnd != -1) { + ic.setSelection(savedSelectionStart, savedSelectionEnd); + } + ic.endBatchEdit(); + sLatinIMEExpectingUpdateSelection = true; if (TextUtils.isEmpty(charSequence)) { values[0] = false; values[1] = ""; |