aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/research/ResearchLogger.java
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2012-08-20 10:17:43 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-20 10:17:43 -0700
commit77257a736ea920e7e618cb0d1b850b544283d439 (patch)
tree3ce6548419189bd50108b72c92cbadd43aaa68e0 /java/src/com/android/inputmethod/research/ResearchLogger.java
parent7cec911fde16775c28db3dbb16b064fc7ce69b55 (diff)
downloadlatinime-77257a736ea920e7e618cb0d1b850b544283d439.tar.gz
latinime-77257a736ea920e7e618cb0d1b850b544283d439.tar.xz
latinime-77257a736ea920e7e618cb0d1b850b544283d439.zip
Revert "ResearchLogger to track simple statistics"
This reverts commit 7cec911fde16775c28db3dbb16b064fc7ce69b55 Change-Id: I3eb055e03a9cf463356ebaefc7827ab65a963072
Diffstat (limited to 'java/src/com/android/inputmethod/research/ResearchLogger.java')
-rw-r--r--java/src/com/android/inputmethod/research/ResearchLogger.java57
1 files changed, 1 insertions, 56 deletions
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java
index b5bdc1958..98ed53656 100644
--- a/java/src/com/android/inputmethod/research/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/research/ResearchLogger.java
@@ -34,7 +34,6 @@ import android.graphics.Paint.Style;
import android.inputmethodservice.InputMethodService;
import android.os.Build;
import android.os.IBinder;
-import android.os.SystemClock;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
@@ -138,12 +137,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
private Dictionary mDictionary;
private KeyboardSwitcher mKeyboardSwitcher;
private InputMethodService mInputMethodService;
- private final Statistics mStatistics;
private ResearchLogUploader mResearchLogUploader;
private ResearchLogger() {
- mStatistics = Statistics.getInstance();
}
public static ResearchLogger getInstance() {
@@ -273,35 +270,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
return new File(filesDir, sb.toString());
}
- private void checkForEmptyEditor() {
- if (mInputMethodService == null) {
- return;
- }
- final InputConnection ic = mInputMethodService.getCurrentInputConnection();
- if (ic == null) {
- return;
- }
- final CharSequence textBefore = ic.getTextBeforeCursor(1, 0);
- if (!TextUtils.isEmpty(textBefore)) {
- mStatistics.setIsEmptyUponStarting(false);
- return;
- }
- final CharSequence textAfter = ic.getTextAfterCursor(1, 0);
- if (!TextUtils.isEmpty(textAfter)) {
- mStatistics.setIsEmptyUponStarting(false);
- return;
- }
- if (textBefore != null && textAfter != null) {
- mStatistics.setIsEmptyUponStarting(true);
- }
- }
-
private void start() {
maybeShowSplashScreen();
updateSuspendedState();
requestIndicatorRedraw();
- mStatistics.reset();
- checkForEmptyEditor();
if (!isAllowedToLog()) {
// Log.w(TAG, "not in usability mode; not logging");
return;
@@ -325,10 +297,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
/* package */ void stop() {
- logStatistics();
- publishLogUnit(mCurrentLogUnit, true);
- mCurrentLogUnit = new LogUnit();
-
if (mMainResearchLog != null) {
mMainResearchLog.stop();
}
@@ -337,26 +305,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
}
- private static final String[] EVENTKEYS_STATISTICS = {
- "Statistics", "charCount", "letterCount", "numberCount", "spaceCount", "deleteOpsCount",
- "wordCount", "isEmptyUponStarting", "isEmptinessStateKnown", "averageTimeBetweenKeys",
- "averageTimeBeforeDelete", "averageTimeDuringRepeatedDelete", "averageTimeAfterDelete"
- };
- private static void logStatistics() {
- final ResearchLogger researchLogger = getInstance();
- final Statistics statistics = researchLogger.mStatistics;
- final Object[] values = {
- statistics.mCharCount, statistics.mLetterCount, statistics.mNumberCount,
- statistics.mSpaceCount, statistics.mDeleteKeyCount,
- statistics.mWordCount, statistics.mIsEmptyUponStarting,
- statistics.mIsEmptinessStateKnown, statistics.mKeyCounter.getAverageTime(),
- statistics.mBeforeDeleteKeyCounter.getAverageTime(),
- statistics.mDuringRepeatedDeleteKeysCounter.getAverageTime(),
- statistics.mAfterDeleteKeyCounter.getAverageTime()
- };
- researchLogger.enqueueEvent(EVENTKEYS_STATISTICS, values);
- }
-
private void setLoggingAllowed(boolean enableLogging) {
if (mPrefs == null) {
return;
@@ -757,7 +705,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
mLoggingFrequencyState.onWordLogged();
}
mCurrentLogUnit = new LogUnit();
- mStatistics.recordWordEntered();
}
private void publishLogUnit(LogUnit logUnit, boolean isPrivacySensitive) {
@@ -952,9 +899,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
final Object[] values = {
Keyboard.printableCode(scrubDigitFromCodePoint(code)), x, y
};
- final ResearchLogger researchLogger = getInstance();
- researchLogger.enqueuePotentiallyPrivateEvent(EVENTKEYS_LATINIME_ONCODEINPUT, values);
- researchLogger.mStatistics.recordChar(code, SystemClock.uptimeMillis());
+ getInstance().enqueuePotentiallyPrivateEvent(EVENTKEYS_LATINIME_ONCODEINPUT, values);
}
private static final String[] EVENTKEYS_LATINIME_ONDISPLAYCOMPLETIONS = {