[Rlog59a] Split logUnits correctly around separators

Change-Id: I65ecdead7e7bdeb8a5f1748e27068ddbd5d3ce00
main
Kurt Partridge 2013-01-10 14:16:47 -08:00
parent 75e69753b7
commit 90aaa2d0a5
2 changed files with 16 additions and 1 deletions

View File

@ -1843,6 +1843,9 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
// Returns true if we did an autocorrection, false otherwise. // Returns true if we did an autocorrection, false otherwise.
private boolean handleSeparator(final int primaryCode, final int x, final int y, private boolean handleSeparator(final int primaryCode, final int x, final int y,
final int spaceState) { final int spaceState) {
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinIME_handleSeparator();
}
boolean didAutoCorrect = false; boolean didAutoCorrect = false;
// Handle separator // Handle separator
if (mWordComposer.isComposingWord()) { if (mWordComposer.isComposingWord()) {

View File

@ -838,6 +838,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
mCurrentLogUnit = newLogUnit; mCurrentLogUnit = newLogUnit;
} }
private void setSavedDownEventTime(final long time) {
mSavedDownEventTime = time;
}
public void onWordFinished(final String word, final boolean isBatchMode) { public void onWordFinished(final String word, final boolean isBatchMode) {
commitCurrentLogUnitAsWord(word, mSavedDownEventTime, isBatchMode); commitCurrentLogUnitAsWord(word, mSavedDownEventTime, isBatchMode);
mSavedDownEventTime = Long.MAX_VALUE; mSavedDownEventTime = Long.MAX_VALUE;
@ -987,7 +991,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
if (action == MotionEvent.ACTION_DOWN) { if (action == MotionEvent.ACTION_DOWN) {
// Subtract 1 from eventTime so the down event is included in the later // Subtract 1 from eventTime so the down event is included in the later
// LogUnit, not the earlier (the test is for inequality). // LogUnit, not the earlier (the test is for inequality).
researchLogger.mSavedDownEventTime = eventTime - 1; researchLogger.setSavedDownEventTime(eventTime - 1);
} }
} }
} }
@ -1627,6 +1631,14 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
researchLogger.mStatistics.recordGestureDelete(); 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. * Log statistics.
* *