diff options
| author | Kurt Partridge <kep@google.com> | 2012-03-30 13:15:46 -0700 |
|---|---|---|
| committer | Kurt Partridge <kep@google.com> | 2012-04-09 09:38:07 -0700 |
| commit | 9bc29d78a6ce83f77869aa63748176241e29d43c (patch) | |
| tree | 24ab9f64c8db278598ac1ce1f384057ca711b6bb /java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | |
| parent | 264045ef81bebfa9eccfe5025c698fcad25942ec (diff) | |
add more data collection points to ResearchLogger (attempt #2)
the new points are all at Log.x() positions; only those appearing directly
related to user input were added.
multi-project change with I159f5de2
this CL is the same as I618bcd07, which was reverted because of
incompatibilities with vendor branches.
Bug: 6188932
Change-Id: I999249dceb0c04f5a4ffbfff25caed09d24a2c52
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 18a3f9794..6949c9d12 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -20,6 +20,8 @@ import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.keyboard.Keyboard; +import com.android.inputmethod.latin.ResearchLogger; +import com.android.inputmethod.latin.define.ProductionFlag; /** * Keyboard state machine. @@ -139,6 +141,9 @@ public class KeyboardState { if (DEBUG_EVENT) { Log.d(TAG, "onSaveKeyboardState: saved=" + state + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onSaveKeyboardState(this, state.toString()); + } } private void onRestoreKeyboardState() { @@ -146,6 +151,9 @@ public class KeyboardState { if (DEBUG_EVENT) { Log.d(TAG, "onRestoreKeyboardState: saved=" + state + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onRestoreKeyboardState(this, state.toString()); + } if (!state.mIsValid || state.mIsAlphabetMode) { setAlphabetKeyboard(); } else { @@ -178,6 +186,9 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode) + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_setShifted(this, shiftModeToString(shiftMode)); + } if (!mIsAlphabetMode) return; final int prevShiftMode; if (mAlphabetShiftState.isAutomaticShifted()) { @@ -217,6 +228,9 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "setShiftLocked: shiftLocked=" + shiftLocked + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_setShiftLocked(this, shiftLocked); + } if (!mIsAlphabetMode) return; if (shiftLocked && (!mAlphabetShiftState.isShiftLocked() || mAlphabetShiftState.isShiftLockShifted())) { @@ -232,6 +246,9 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "toggleAlphabetAndSymbols: " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_toggleAlphabetAndSymbols(this); + } if (mIsAlphabetMode) { mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked(); if (mPrevSymbolsKeyboardWasShifted) { @@ -262,6 +279,10 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "setAlphabetKeyboard"); } + + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_setAlphabetKeyboard(); + } mSwitchActions.setAlphabetKeyboard(); mIsAlphabetMode = true; mIsSymbolShifted = false; @@ -273,6 +294,9 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "setSymbolsKeyboard"); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_setSymbolsKeyboard(); + } mSwitchActions.setSymbolsKeyboard(); mIsAlphabetMode = false; mIsSymbolShifted = false; @@ -285,6 +309,9 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "setSymbolsShiftedKeyboard"); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_setSymbolsShiftedKeyboard(); + } mSwitchActions.setSymbolsShiftedKeyboard(); mIsAlphabetMode = false; mIsSymbolShifted = true; @@ -297,6 +324,9 @@ public class KeyboardState { if (DEBUG_EVENT) { Log.d(TAG, "onPressKey: code=" + Keyboard.printableCode(code) + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onPressKey(code, this); + } if (code == Keyboard.CODE_SHIFT) { onPressShift(); } else if (code == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { @@ -314,6 +344,9 @@ public class KeyboardState { Log.d(TAG, "onReleaseKey: code=" + Keyboard.printableCode(code) + " sliding=" + withSliding + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onReleaseKey(this, code, withSliding); + } if (code == Keyboard.CODE_SHIFT) { onReleaseShift(withSliding); } else if (code == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { @@ -345,6 +378,9 @@ public class KeyboardState { if (DEBUG_EVENT) { Log.d(TAG, "onLongPressTimeout: code=" + Keyboard.printableCode(code) + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onLongPressTimeout(code, this); + } if (mIsAlphabetMode && code == Keyboard.CODE_SHIFT) { if (mAlphabetShiftState.isShiftLocked()) { setShiftLocked(false); @@ -363,6 +399,9 @@ public class KeyboardState { if (DEBUG_EVENT) { Log.d(TAG, "onUpdateShiftState: autoCaps=" + autoCaps + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onUpdateShiftState(this, autoCaps); + } updateAlphabetShiftState(autoCaps); } @@ -481,6 +520,9 @@ public class KeyboardState { if (DEBUG_EVENT) { Log.d(TAG, "onCancelInput: single=" + isSinglePointer + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onCancelInput(isSinglePointer, this); + } // Switch back to the previous keyboard mode if the user cancels sliding input. if (isSinglePointer) { if (mSwitchState == SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL) { @@ -512,6 +554,9 @@ public class KeyboardState { + " single=" + isSinglePointer + " autoCaps=" + autoCaps + " " + this); } + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.keyboardState_onCodeInput(code, isSinglePointer, autoCaps, this); + } switch (mSwitchState) { case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL: |
