diff options
Diffstat (limited to 'java/src/com/android/inputmethod/research')
3 files changed, 16 insertions, 21 deletions
diff --git a/java/src/com/android/inputmethod/research/MainLogBuffer.java b/java/src/com/android/inputmethod/research/MainLogBuffer.java index 3482153b4..6df7c1708 100644 --- a/java/src/com/android/inputmethod/research/MainLogBuffer.java +++ b/java/src/com/android/inputmethod/research/MainLogBuffer.java @@ -119,9 +119,9 @@ public abstract class MainLogBuffer extends FixedLogBuffer { * * @param logUnits a LogUnit list to check for publishability * @param nGramSize the smallest n-gram acceptable to be published. if - * {@link ResearchLogger.IS_LOGGING_EVERYTHING} is true, then publish if there are more than + * {@link ResearchLogger#IS_LOGGING_EVERYTHING} is true, then publish if there are more than * {@code minNGramSize} words in the logUnits, otherwise wait. if {@link - * ResearchLogger.IS_LOGGING_EVERYTHING} is false, then ensure that there are exactly nGramSize + * ResearchLogger#IS_LOGGING_EVERYTHING} is false, then ensure that there are exactly nGramSize * words in the LogUnits. * * @return one of the {@code PUBLISHABILITY_*} result codes defined in this class. diff --git a/java/src/com/android/inputmethod/research/MotionEventReader.java b/java/src/com/android/inputmethod/research/MotionEventReader.java index fbfd9b531..3388645b7 100644 --- a/java/src/com/android/inputmethod/research/MotionEventReader.java +++ b/java/src/com/android/inputmethod/research/MotionEventReader.java @@ -315,16 +315,6 @@ public class MotionEventReader { return pointerCoords; } - /** - * Tests that {@code x} is uninitialized. - * - * Assumes that {@code x} will never be given a valid value less than 0, and that - * UNINITIALIZED_FLOAT is less than 0.0f. - */ - private boolean isUninitializedFloat(final float x) { - return x < 0.0f; - } - private void addMotionEventData(final ReplayData replayData, final int actionType, final long time, final PointerProperties[] pointerProperties, final PointerCoords[] pointerCoords) { diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index ed047e13a..fc8615b71 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -180,7 +180,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang private ResearchLogDirectory mResearchLogDirectory; private SplashScreen mSplashScreen; - private Intent mUploadIntent; private Intent mUploadNowIntent; /* package for test */ LogUnit mCurrentLogUnit = new LogUnit(); @@ -233,7 +232,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang resetLogBuffers(); // Initialize external services - mUploadIntent = new Intent(mLatinIME, UploaderService.class); mUploadNowIntent = new Intent(mLatinIME, UploaderService.class); mUploadNowIntent.putExtra(UploaderService.EXTRA_UPLOAD_UNCONDITIONALLY, true); if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { @@ -319,12 +317,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang restart(); } - private void setLoggingAllowed(final boolean enableLogging) { - if (mPrefs == null) return; - sIsLogging = enableLogging; - ResearchSettings.writeResearchLoggerEnabledFlag(mPrefs, enableLogging); - } - private void checkForEmptyEditor() { if (mLatinIME == null) { return; @@ -1261,10 +1253,23 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang private static final LogStatement LOGSTATEMENT_LATINIME_PICKSUGGESTIONMANUALLY = new LogStatement("LatinIMEPickSuggestionManually", true, false, "replacedWord", "index", "suggestion", "x", "y", "isBatchMode", "score", "kind", "sourceDict"); + /** + * Log a call to LatinIME.pickSuggestionManually(). + * + * @param replacedWord the typed word that this manual suggestion replaces. May not be null. + * @param index the index in the suggestion strip + * @param suggestion the committed suggestion. May not be null. + * @param isBatchMode whether this was input in batch mode, aka gesture. + * @param score the internal score of the suggestion, as output by the dictionary + * @param kind the kind of suggestion, as one of the SuggestedWordInfo#KIND_* constants + * @param sourceDict the source origin of this word, as one of the Dictionary#TYPE_* constants. + */ public static void latinIME_pickSuggestionManually(final String replacedWord, final int index, final String suggestion, final boolean isBatchMode, final int score, final int kind, final String sourceDict) { final ResearchLogger researchLogger = getInstance(); + // Note : suggestion can't be null here, because it's only called in a place where it + // can't be null. if (!replacedWord.equals(suggestion.toString())) { // The user chose something other than what was already there. researchLogger.setCurrentLogUnitContainsUserDeletions(); @@ -1273,7 +1278,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang final String scrubbedWord = scrubDigitsFromString(suggestion); researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_PICKSUGGESTIONMANUALLY, scrubDigitsFromString(replacedWord), index, - suggestion == null ? null : scrubbedWord, Constants.SUGGESTION_STRIP_COORDINATE, + scrubbedWord, Constants.SUGGESTION_STRIP_COORDINATE, Constants.SUGGESTION_STRIP_COORDINATE, isBatchMode, score, kind, sourceDict); researchLogger.commitCurrentLogUnitAsWord(scrubbedWord, Long.MAX_VALUE, isBatchMode); researchLogger.mStatistics.recordManualSuggestion(SystemClock.uptimeMillis()); |