Loading java/src/com/android/inputmethod/research/ResearchLogger.java +18 −4 Original line number Diff line number Diff line Loading @@ -1153,7 +1153,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang suggestion == null ? null : scrubbedWord, Constants.SUGGESTION_STRIP_COORDINATE, Constants.SUGGESTION_STRIP_COORDINATE); researchLogger.commitCurrentLogUnitAsWord(scrubbedWord, Long.MAX_VALUE, isBatchMode); researchLogger.mStatistics.recordManualSuggestion(); researchLogger.mStatistics.recordManualSuggestion(SystemClock.uptimeMillis()); } /** Loading Loading @@ -1281,7 +1281,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang } researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit, LOGSTATEMENT_LATINIME_REVERTCOMMIT, committedWord, originallyTypedWord); researchLogger.mStatistics.recordRevertCommit(); researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis()); researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord, Long.MAX_VALUE, isBatchMode); } Loading Loading @@ -1611,7 +1611,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang final ResearchLogger researchLogger = getInstance(); researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONENDBATCHINPUT, enteredText, enteredWordPos); researchLogger.mStatistics.recordGestureInput(enteredText.length()); researchLogger.mStatistics.recordGestureInput(enteredText.length(), SystemClock.uptimeMillis()); } /** Loading @@ -1624,7 +1625,20 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang public static void latinIME_handleBackspace_batch(final CharSequence deletedText) { final ResearchLogger researchLogger = getInstance(); researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_HANDLEBACKSPACE_BATCH, deletedText); researchLogger.mStatistics.recordGestureDelete(); researchLogger.mStatistics.recordGestureDelete(deletedText.length(), SystemClock.uptimeMillis()); } /** * Log a long interval between user operation. * * UserInput: The user has not done anything for a while. */ private static final LogStatement LOGSTATEMENT_ONUSERPAUSE = new LogStatement("OnUserPause", false, false, "intervalInMs"); public static void onUserPause(final long interval) { final ResearchLogger researchLogger = getInstance(); researchLogger.enqueueEvent(LOGSTATEMENT_ONUSERPAUSE, interval); } /** Loading java/src/com/android/inputmethod/research/Statistics.java +36 −20 Original line number Diff line number Diff line Loading @@ -134,17 +134,9 @@ public class Statistics { if (DEBUG) { Log.d(TAG, "recordChar() called"); } final long delta = time - mLastTapTime; if (codePoint == Constants.CODE_DELETE) { mDeleteKeyCount++; if (delta < MIN_DELETION_INTERMISSION) { if (mIsLastKeyDeleteKey) { mDuringRepeatedDeleteKeysCounter.add(delta); } else { mBeforeDeleteKeyCounter.add(delta); } } mIsLastKeyDeleteKey = true; recordUserAction(time, true /* isDeletion */); } else { mCharCount++; if (Character.isDigit(codePoint)) { Loading @@ -156,14 +148,8 @@ public class Statistics { if (Character.isSpaceChar(codePoint)) { mSpaceCount++; } if (mIsLastKeyDeleteKey && delta < MIN_DELETION_INTERMISSION) { mAfterDeleteKeyCounter.add(delta); } else if (!mIsLastKeyDeleteKey && delta < MIN_TYPING_INTERMISSION) { mKeyCounter.add(delta); } mIsLastKeyDeleteKey = false; recordUserAction(time, false /* isDeletion */); } mLastTapTime = time; } public void recordWordEntered(final boolean isDictionaryWord) { Loading @@ -177,9 +163,10 @@ public class Statistics { mSplitWordsCount++; } public void recordGestureInput(final int numCharsEntered) { public void recordGestureInput(final int numCharsEntered, final long time) { mGesturesInputCount++; mGesturesCharsCount += numCharsEntered; recordUserAction(time, false /* isDeletion */); } public void setIsEmptyUponStarting(final boolean isEmpty) { Loading @@ -187,14 +174,43 @@ public class Statistics { mIsEmptinessStateKnown = true; } public void recordGestureDelete() { public void recordGestureDelete(final int length, final long time) { mGesturesDeletedCount++; recordUserAction(time, true /* isDeletion */); } public void recordManualSuggestion() { public void recordManualSuggestion(final long time) { mManualSuggestionsCount++; recordUserAction(time, false /* isDeletion */); } public void recordRevertCommit() { public void recordRevertCommit(final long time) { mRevertCommitsCount++; recordUserAction(time, true /* isDeletion */); } private void recordUserAction(final long time, final boolean isDeletion) { final long delta = time - mLastTapTime; if (isDeletion) { if (delta < MIN_DELETION_INTERMISSION) { if (mIsLastKeyDeleteKey) { mDuringRepeatedDeleteKeysCounter.add(delta); } else { mBeforeDeleteKeyCounter.add(delta); } } else { ResearchLogger.onUserPause(delta); } } else { if (mIsLastKeyDeleteKey && delta < MIN_DELETION_INTERMISSION) { mAfterDeleteKeyCounter.add(delta); } else if (!mIsLastKeyDeleteKey && delta < MIN_TYPING_INTERMISSION) { mKeyCounter.add(delta); } else { ResearchLogger.onUserPause(delta); } } mIsLastKeyDeleteKey = isDeletion; mLastTapTime = time; } } Loading
java/src/com/android/inputmethod/research/ResearchLogger.java +18 −4 Original line number Diff line number Diff line Loading @@ -1153,7 +1153,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang suggestion == null ? null : scrubbedWord, Constants.SUGGESTION_STRIP_COORDINATE, Constants.SUGGESTION_STRIP_COORDINATE); researchLogger.commitCurrentLogUnitAsWord(scrubbedWord, Long.MAX_VALUE, isBatchMode); researchLogger.mStatistics.recordManualSuggestion(); researchLogger.mStatistics.recordManualSuggestion(SystemClock.uptimeMillis()); } /** Loading Loading @@ -1281,7 +1281,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang } researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit, LOGSTATEMENT_LATINIME_REVERTCOMMIT, committedWord, originallyTypedWord); researchLogger.mStatistics.recordRevertCommit(); researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis()); researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord, Long.MAX_VALUE, isBatchMode); } Loading Loading @@ -1611,7 +1611,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang final ResearchLogger researchLogger = getInstance(); researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONENDBATCHINPUT, enteredText, enteredWordPos); researchLogger.mStatistics.recordGestureInput(enteredText.length()); researchLogger.mStatistics.recordGestureInput(enteredText.length(), SystemClock.uptimeMillis()); } /** Loading @@ -1624,7 +1625,20 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang public static void latinIME_handleBackspace_batch(final CharSequence deletedText) { final ResearchLogger researchLogger = getInstance(); researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_HANDLEBACKSPACE_BATCH, deletedText); researchLogger.mStatistics.recordGestureDelete(); researchLogger.mStatistics.recordGestureDelete(deletedText.length(), SystemClock.uptimeMillis()); } /** * Log a long interval between user operation. * * UserInput: The user has not done anything for a while. */ private static final LogStatement LOGSTATEMENT_ONUSERPAUSE = new LogStatement("OnUserPause", false, false, "intervalInMs"); public static void onUserPause(final long interval) { final ResearchLogger researchLogger = getInstance(); researchLogger.enqueueEvent(LOGSTATEMENT_ONUSERPAUSE, interval); } /** Loading
java/src/com/android/inputmethod/research/Statistics.java +36 −20 Original line number Diff line number Diff line Loading @@ -134,17 +134,9 @@ public class Statistics { if (DEBUG) { Log.d(TAG, "recordChar() called"); } final long delta = time - mLastTapTime; if (codePoint == Constants.CODE_DELETE) { mDeleteKeyCount++; if (delta < MIN_DELETION_INTERMISSION) { if (mIsLastKeyDeleteKey) { mDuringRepeatedDeleteKeysCounter.add(delta); } else { mBeforeDeleteKeyCounter.add(delta); } } mIsLastKeyDeleteKey = true; recordUserAction(time, true /* isDeletion */); } else { mCharCount++; if (Character.isDigit(codePoint)) { Loading @@ -156,14 +148,8 @@ public class Statistics { if (Character.isSpaceChar(codePoint)) { mSpaceCount++; } if (mIsLastKeyDeleteKey && delta < MIN_DELETION_INTERMISSION) { mAfterDeleteKeyCounter.add(delta); } else if (!mIsLastKeyDeleteKey && delta < MIN_TYPING_INTERMISSION) { mKeyCounter.add(delta); } mIsLastKeyDeleteKey = false; recordUserAction(time, false /* isDeletion */); } mLastTapTime = time; } public void recordWordEntered(final boolean isDictionaryWord) { Loading @@ -177,9 +163,10 @@ public class Statistics { mSplitWordsCount++; } public void recordGestureInput(final int numCharsEntered) { public void recordGestureInput(final int numCharsEntered, final long time) { mGesturesInputCount++; mGesturesCharsCount += numCharsEntered; recordUserAction(time, false /* isDeletion */); } public void setIsEmptyUponStarting(final boolean isEmpty) { Loading @@ -187,14 +174,43 @@ public class Statistics { mIsEmptinessStateKnown = true; } public void recordGestureDelete() { public void recordGestureDelete(final int length, final long time) { mGesturesDeletedCount++; recordUserAction(time, true /* isDeletion */); } public void recordManualSuggestion() { public void recordManualSuggestion(final long time) { mManualSuggestionsCount++; recordUserAction(time, false /* isDeletion */); } public void recordRevertCommit() { public void recordRevertCommit(final long time) { mRevertCommitsCount++; recordUserAction(time, true /* isDeletion */); } private void recordUserAction(final long time, final boolean isDeletion) { final long delta = time - mLastTapTime; if (isDeletion) { if (delta < MIN_DELETION_INTERMISSION) { if (mIsLastKeyDeleteKey) { mDuringRepeatedDeleteKeysCounter.add(delta); } else { mBeforeDeleteKeyCounter.add(delta); } } else { ResearchLogger.onUserPause(delta); } } else { if (mIsLastKeyDeleteKey && delta < MIN_DELETION_INTERMISSION) { mAfterDeleteKeyCounter.add(delta); } else if (!mIsLastKeyDeleteKey && delta < MIN_TYPING_INTERMISSION) { mKeyCounter.add(delta); } else { ResearchLogger.onUserPause(delta); } } mIsLastKeyDeleteKey = isDeletion; mLastTapTime = time; } }