Merge "remove unnecessary KeyboardState logging"

main
Kurt Partridge 2012-04-19 20:53:44 -07:00 committed by Android (Google) Code Review
commit 5b92113cdb
3 changed files with 0 additions and 153 deletions

View File

@ -18,9 +18,6 @@ package com.android.inputmethod.keyboard.internal;
import android.util.Log; import android.util.Log;
import com.android.inputmethod.latin.ResearchLogger;
import com.android.inputmethod.latin.define.ProductionFlag;
public class AlphabetShiftState { public class AlphabetShiftState {
private static final String TAG = AlphabetShiftState.class.getSimpleName(); private static final String TAG = AlphabetShiftState.class.getSimpleName();
private static final boolean DEBUG = false; private static final boolean DEBUG = false;
@ -62,9 +59,6 @@ public class AlphabetShiftState {
} }
if (DEBUG) if (DEBUG)
Log.d(TAG, "setShifted(" + newShiftState + "): " + toString(oldState) + " > " + this); Log.d(TAG, "setShifted(" + newShiftState + "): " + toString(oldState) + " > " + this);
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.alphabetShiftState_setShifted(newShiftState, oldState, this);
}
} }
public void setShiftLocked(boolean newShiftLockState) { public void setShiftLocked(boolean newShiftLockState) {
@ -84,9 +78,6 @@ public class AlphabetShiftState {
if (DEBUG) if (DEBUG)
Log.d(TAG, "setShiftLocked(" + newShiftLockState + "): " + toString(oldState) Log.d(TAG, "setShiftLocked(" + newShiftLockState + "): " + toString(oldState)
+ " > " + this); + " > " + this);
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.alphabetShiftState_setShiftLocked(newShiftLockState, oldState, this);
}
} }
public void setAutomaticShifted() { public void setAutomaticShifted() {
@ -94,9 +85,6 @@ public class AlphabetShiftState {
mState = AUTOMATIC_SHIFTED; mState = AUTOMATIC_SHIFTED;
if (DEBUG) if (DEBUG)
Log.d(TAG, "setAutomaticShifted: " + toString(oldState) + " > " + this); Log.d(TAG, "setAutomaticShifted: " + toString(oldState) + " > " + this);
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.alphabetShiftState_setAutomaticShifted(oldState, this);
}
} }
public boolean isShiftedOrShiftLocked() { public boolean isShiftedOrShiftLocked() {

View File

@ -141,9 +141,6 @@ public class KeyboardState {
if (DEBUG_EVENT) { if (DEBUG_EVENT) {
Log.d(TAG, "onSaveKeyboardState: saved=" + state + " " + this); Log.d(TAG, "onSaveKeyboardState: saved=" + state + " " + this);
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_onSaveKeyboardState(this, state.toString());
}
} }
private void onRestoreKeyboardState() { private void onRestoreKeyboardState() {
@ -151,9 +148,6 @@ public class KeyboardState {
if (DEBUG_EVENT) { if (DEBUG_EVENT) {
Log.d(TAG, "onRestoreKeyboardState: saved=" + state + " " + this); Log.d(TAG, "onRestoreKeyboardState: saved=" + state + " " + this);
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_onRestoreKeyboardState(this, state.toString());
}
if (!state.mIsValid || state.mIsAlphabetMode) { if (!state.mIsValid || state.mIsAlphabetMode) {
setAlphabetKeyboard(); setAlphabetKeyboard();
} else { } else {
@ -186,9 +180,6 @@ public class KeyboardState {
if (DEBUG_ACTION) { if (DEBUG_ACTION) {
Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode) + " " + this); Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode) + " " + this);
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_setShifted(this, shiftModeToString(shiftMode));
}
if (!mIsAlphabetMode) return; if (!mIsAlphabetMode) return;
final int prevShiftMode; final int prevShiftMode;
if (mAlphabetShiftState.isAutomaticShifted()) { if (mAlphabetShiftState.isAutomaticShifted()) {
@ -228,9 +219,6 @@ public class KeyboardState {
if (DEBUG_ACTION) { if (DEBUG_ACTION) {
Log.d(TAG, "setShiftLocked: shiftLocked=" + shiftLocked + " " + this); Log.d(TAG, "setShiftLocked: shiftLocked=" + shiftLocked + " " + this);
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_setShiftLocked(this, shiftLocked);
}
if (!mIsAlphabetMode) return; if (!mIsAlphabetMode) return;
if (shiftLocked && (!mAlphabetShiftState.isShiftLocked() if (shiftLocked && (!mAlphabetShiftState.isShiftLocked()
|| mAlphabetShiftState.isShiftLockShifted())) { || mAlphabetShiftState.isShiftLockShifted())) {
@ -246,9 +234,6 @@ public class KeyboardState {
if (DEBUG_ACTION) { if (DEBUG_ACTION) {
Log.d(TAG, "toggleAlphabetAndSymbols: " + this); Log.d(TAG, "toggleAlphabetAndSymbols: " + this);
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_toggleAlphabetAndSymbols(this);
}
if (mIsAlphabetMode) { if (mIsAlphabetMode) {
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked(); mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
if (mPrevSymbolsKeyboardWasShifted) { if (mPrevSymbolsKeyboardWasShifted) {
@ -280,9 +265,6 @@ public class KeyboardState {
Log.d(TAG, "setAlphabetKeyboard"); Log.d(TAG, "setAlphabetKeyboard");
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_setAlphabetKeyboard();
}
mSwitchActions.setAlphabetKeyboard(); mSwitchActions.setAlphabetKeyboard();
mIsAlphabetMode = true; mIsAlphabetMode = true;
mIsSymbolShifted = false; mIsSymbolShifted = false;
@ -294,9 +276,6 @@ public class KeyboardState {
if (DEBUG_ACTION) { if (DEBUG_ACTION) {
Log.d(TAG, "setSymbolsKeyboard"); Log.d(TAG, "setSymbolsKeyboard");
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_setSymbolsKeyboard();
}
mSwitchActions.setSymbolsKeyboard(); mSwitchActions.setSymbolsKeyboard();
mIsAlphabetMode = false; mIsAlphabetMode = false;
mIsSymbolShifted = false; mIsSymbolShifted = false;
@ -309,9 +288,6 @@ public class KeyboardState {
if (DEBUG_ACTION) { if (DEBUG_ACTION) {
Log.d(TAG, "setSymbolsShiftedKeyboard"); Log.d(TAG, "setSymbolsShiftedKeyboard");
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_setSymbolsShiftedKeyboard();
}
mSwitchActions.setSymbolsShiftedKeyboard(); mSwitchActions.setSymbolsShiftedKeyboard();
mIsAlphabetMode = false; mIsAlphabetMode = false;
mIsSymbolShifted = true; mIsSymbolShifted = true;
@ -399,9 +375,6 @@ public class KeyboardState {
if (DEBUG_EVENT) { if (DEBUG_EVENT) {
Log.d(TAG, "onUpdateShiftState: autoCaps=" + autoCaps + " " + this); Log.d(TAG, "onUpdateShiftState: autoCaps=" + autoCaps + " " + this);
} }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.keyboardState_onUpdateShiftState(this, autoCaps);
}
updateAlphabetShiftState(autoCaps); updateAlphabetShiftState(autoCaps);
} }

View File

@ -33,7 +33,6 @@ import android.view.inputmethod.EditorInfo;
import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.KeyDetector;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.internal.AlphabetShiftState;
import com.android.inputmethod.keyboard.internal.KeyboardState; import com.android.inputmethod.keyboard.internal.KeyboardState;
import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.define.ProductionFlag;
@ -327,26 +326,11 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
public static class UnsLogGroup { public static class UnsLogGroup {
private static final boolean DEFAULT_ENABLED = true; private static final boolean DEFAULT_ENABLED = true;
private static final boolean ALPHABETSHIFTSTATE_SETSHIFTED_ENABLED = DEFAULT_ENABLED;
private static final boolean ALPHABETSHIFTSTATE_SETSHIFTLOCKED_ENABLED = DEFAULT_ENABLED;
private static final boolean ALPHABETSHIFTSTATE_SETAUTOMATICSHIFTED_ENABLED
= DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONCANCELINPUT_ENABLED = DEFAULT_ENABLED; private static final boolean KEYBOARDSTATE_ONCANCELINPUT_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONCODEINPUT_ENABLED = DEFAULT_ENABLED; private static final boolean KEYBOARDSTATE_ONCODEINPUT_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONLONGPRESSTIMEOUT_ENABLED = DEFAULT_ENABLED; private static final boolean KEYBOARDSTATE_ONLONGPRESSTIMEOUT_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONPRESSKEY_ENABLED = DEFAULT_ENABLED; private static final boolean KEYBOARDSTATE_ONPRESSKEY_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONRELEASEKEY_ENABLED = DEFAULT_ENABLED; private static final boolean KEYBOARDSTATE_ONRELEASEKEY_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONRESTOREKEYBOARDSTATE_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONSAVEKEYBOARDSTATE_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_ONUPDATESHIFTSTATE_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_SETALPHABETKEYBOARD_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_SETSHIFTED_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_SETSHIFTLOCKED_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_SETSYMBOLSKEYBOARD_ENABLED = DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_SETSYMBOLSSHIFTEDKEYBOARD_ENABLED
= DEFAULT_ENABLED;
private static final boolean KEYBOARDSTATE_TOGGLEALPHABETANDSYMBOLS_ENABLED
= DEFAULT_ENABLED;
private static final boolean LATINIME_COMMITCURRENTAUTOCORRECTION_ENABLED = DEFAULT_ENABLED; private static final boolean LATINIME_COMMITCURRENTAUTOCORRECTION_ENABLED = DEFAULT_ENABLED;
private static final boolean LATINIME_COMMITTEXT_ENABLED = DEFAULT_ENABLED; private static final boolean LATINIME_COMMITTEXT_ENABLED = DEFAULT_ENABLED;
private static final boolean LATINIME_DELETESURROUNDINGTEXT_ENABLED = DEFAULT_ENABLED; private static final boolean LATINIME_DELETESURROUNDINGTEXT_ENABLED = DEFAULT_ENABLED;
@ -451,34 +435,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
sIsLogging = prefs.getBoolean(PREF_USABILITY_STUDY_MODE, false); sIsLogging = prefs.getBoolean(PREF_USABILITY_STUDY_MODE, false);
} }
public static void alphabetShiftState_setShifted(final boolean newShiftState,
final int oldState, final AlphabetShiftState alphabetShiftState) {
if (UnsLogGroup.ALPHABETSHIFTSTATE_SETSHIFTED_ENABLED) {
final String s = "setShifted(" + newShiftState + "): " + oldState
+ " > " + alphabetShiftState;
logUnstructured("AlphabetShiftState_setShifted", s);
}
}
public static void alphabetShiftState_setShiftLocked(final boolean newShiftLockState,
final int oldState, final AlphabetShiftState alphabetShiftState) {
if (UnsLogGroup.ALPHABETSHIFTSTATE_SETSHIFTLOCKED_ENABLED) {
final String s = "setShiftLocked(" + newShiftLockState + "): "
+ oldState + " > " + alphabetShiftState;
logUnstructured("AlphabetShiftState_setShiftLocked", s);
}
}
public static void alphabetShiftState_setAutomaticShifted(final int oldState,
final AlphabetShiftState alphabetShiftState) {
if (UnsLogGroup.ALPHABETSHIFTSTATE_SETAUTOMATICSHIFTED_ENABLED) {
final String s = "setAutomaticShifted: " + oldState + " > " + alphabetShiftState;
logUnstructured("AlphabetShiftState_setAutomaticShifted", s);
}
}
// TODO: Remove keyboardState logging that is redundant in light of
// latinKeyboardView_setKeyboard
public static void keyboardState_onCancelInput(final boolean isSinglePointer, public static void keyboardState_onCancelInput(final boolean isSinglePointer,
final KeyboardState keyboardState) { final KeyboardState keyboardState) {
if (UnsLogGroup.KEYBOARDSTATE_ONCANCELINPUT_ENABLED) { if (UnsLogGroup.KEYBOARDSTATE_ONCANCELINPUT_ENABLED) {
@ -525,76 +481,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
} }
} }
public static void keyboardState_onRestoreKeyboardState(final KeyboardState keyboardState,
final String savedKeyboardState) {
if (UnsLogGroup.KEYBOARDSTATE_ONRESTOREKEYBOARDSTATE_ENABLED) {
final String s = "onRestoreKeyboardState: saved=" + savedKeyboardState + " "
+ keyboardState;
logUnstructured("KeyboardState_onRestoreKeyboardState", s);
}
}
public static void keyboardState_onSaveKeyboardState(final KeyboardState keyboardState,
final String savedKeyboardState) {
if (UnsLogGroup.KEYBOARDSTATE_ONSAVEKEYBOARDSTATE_ENABLED) {
final String s = "onSaveKeyboardState: saved=" + savedKeyboardState + " "
+ keyboardState;
logUnstructured("KeyboardState_onSaveKeyboardState", s);
}
}
public static void keyboardState_onUpdateShiftState(final KeyboardState keyboardState,
final boolean autoCaps) {
if (UnsLogGroup.KEYBOARDSTATE_ONUPDATESHIFTSTATE_ENABLED) {
final String s = "onUpdateShiftState: autoCaps=" + autoCaps + " " + keyboardState;
logUnstructured("KeyboardState_onUpdateShiftState", s);
}
}
public static void keyboardState_setAlphabetKeyboard() {
if (UnsLogGroup.KEYBOARDSTATE_SETALPHABETKEYBOARD_ENABLED) {
final String s = "setAlphabetKeyboard";
logUnstructured("KeyboardState_setAlphabetKeyboard", s);
}
}
public static void keyboardState_setShifted(final KeyboardState keyboardState,
final String shiftMode) {
if (UnsLogGroup.KEYBOARDSTATE_SETSHIFTED_ENABLED) {
final String s = "setShifted: shiftMode=" + shiftMode + " " + keyboardState;
logUnstructured("KeyboardState_setShifted", s);
}
}
public static void keyboardState_setShiftLocked(final KeyboardState keyboardState,
final boolean shiftLocked) {
if (UnsLogGroup.KEYBOARDSTATE_SETSHIFTLOCKED_ENABLED) {
final String s = "setShiftLocked: shiftLocked=" + shiftLocked + " " + keyboardState;
logUnstructured("KeyboardState_setShiftLocked", s);
}
}
public static void keyboardState_setSymbolsKeyboard() {
if (UnsLogGroup.KEYBOARDSTATE_SETSYMBOLSKEYBOARD_ENABLED) {
final String s = "setSymbolsKeyboard";
logUnstructured("KeyboardState_setSymbolsKeyboard", s);
}
}
public static void keyboardState_setSymbolsShiftedKeyboard() {
if (UnsLogGroup.KEYBOARDSTATE_SETSYMBOLSSHIFTEDKEYBOARD_ENABLED) {
final String s = "setSymbolsShiftedKeyboard";
logUnstructured("KeyboardState_setSymbolsShiftedKeyboard", s);
}
}
public static void keyboardState_toggleAlphabetAndSymbols(final KeyboardState keyboardState) {
if (UnsLogGroup.KEYBOARDSTATE_TOGGLEALPHABETANDSYMBOLS_ENABLED) {
final String s = "toggleAlphabetAndSymbols: " + keyboardState;
logUnstructured("KeyboardState_toggleAlphabetAndSymbols", s);
}
}
public static void latinIME_commitCurrentAutoCorrection(final String typedWord, public static void latinIME_commitCurrentAutoCorrection(final String typedWord,
final String autoCorrection) { final String autoCorrection) {
if (UnsLogGroup.LATINIME_COMMITCURRENTAUTOCORRECTION_ENABLED) { if (UnsLogGroup.LATINIME_COMMITCURRENTAUTOCORRECTION_ENABLED) {