diff options
author | 2013-01-11 09:20:34 -0800 | |
---|---|---|
committer | 2013-01-11 09:20:34 -0800 | |
commit | 988a2d0c877f43fef22cf1ea5157210ec3471d88 (patch) | |
tree | 6baf7c99e6f4cfdc54da651da0128248e51d595a /java/src | |
parent | 53f9fe1b90932ea255ca604dd0f4e360af1d54a8 (diff) | |
parent | 5523a6818d77cd198e349f075bb1bb5acaff5b71 (diff) | |
download | latinime-988a2d0c877f43fef22cf1ea5157210ec3471d88.tar.gz latinime-988a2d0c877f43fef22cf1ea5157210ec3471d88.tar.xz latinime-988a2d0c877f43fef22cf1ea5157210ec3471d88.zip |
am 5523a681: Merge "[Rlog59a] Split logUnits correctly around separators"
* commit '5523a6818d77cd198e349f075bb1bb5acaff5b71':
[Rlog59a] Split logUnits correctly around separators
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/research/ResearchLogger.java | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 8c8a824d8..152118d98 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1843,6 +1843,9 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Returns true if we did an autocorrection, false otherwise. private boolean handleSeparator(final int primaryCode, final int x, final int y, final int spaceState) { + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.latinIME_handleSeparator(); + } boolean didAutoCorrect = false; // Handle separator if (mWordComposer.isComposingWord()) { diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index 01b5bdda5..e8c3bdf81 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -838,6 +838,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang mCurrentLogUnit = newLogUnit; } + private void setSavedDownEventTime(final long time) { + mSavedDownEventTime = time; + } + public void onWordFinished(final String word, final boolean isBatchMode) { commitCurrentLogUnitAsWord(word, mSavedDownEventTime, isBatchMode); mSavedDownEventTime = Long.MAX_VALUE; @@ -987,7 +991,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang if (action == MotionEvent.ACTION_DOWN) { // Subtract 1 from eventTime so the down event is included in the later // LogUnit, not the earlier (the test is for inequality). - researchLogger.mSavedDownEventTime = eventTime - 1; + researchLogger.setSavedDownEventTime(eventTime - 1); } } } @@ -1637,6 +1641,14 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang researchLogger.mStatistics.recordGestureDelete(); } + public static void latinIME_handleSeparator() { + // Reset the saved down event time. For tapping, motion events, etc. before the separator + // are assigned to the previous LogUnit, and events after the separator are assigned to the + // next LogUnit. In the case of multitap, this might capture down events corresponding to + // the next word, however it should not be more than a character or two. + getInstance().setSavedDownEventTime(SystemClock.uptimeMillis()); + } + /** * Log statistics. * |