aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2012-12-23 11:49:39 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-23 11:49:39 -0800
commitd357398bf76bcc575d54f553d3322f52c2a33c91 (patch)
treea1087b1aca1899883f90e247f2f9f48bff9bc410 /java/src/com/android/inputmethod
parent970ceab0a876b7c7d8e3a96a03c156b824ee91d5 (diff)
parent13b1be988d49818c48949d2534ffe31ed8475cfb (diff)
downloadlatinime-d357398bf76bcc575d54f553d3322f52c2a33c91.tar.gz
latinime-d357398bf76bcc575d54f553d3322f52c2a33c91.tar.xz
latinime-d357398bf76bcc575d54f553d3322f52c2a33c91.zip
am 13b1be98: Merge "Log LatinIME.commitCurrentAutoCorrection()"
* commit '13b1be988d49818c48949d2534ffe31ed8475cfb': Log LatinIME.commitCurrentAutoCorrection()
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
-rw-r--r--java/src/com/android/inputmethod/research/ResearchLogger.java22
2 files changed, 26 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 7dfaf6cee..ae9c1df38 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2095,6 +2095,11 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
typedWord, autoCorrection.toString(), separatorString, mWordComposer);
}
mExpectingUpdateSelection = true;
+ if (ProductionFlag.IS_EXPERIMENTAL) {
+ ResearchLogger.latinIme_commitCurrentAutoCorrection(typedWord,
+ autoCorrection.toString(), separatorString);
+ }
+
commitChosenWord(autoCorrection, LastComposedWord.COMMIT_TYPE_DECIDED_WORD,
separatorString);
if (!typedWord.equals(autoCorrection)) {
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java
index ab436c78d..ec3d4eda4 100644
--- a/java/src/com/android/inputmethod/research/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/research/ResearchLogger.java
@@ -1243,6 +1243,26 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
completionInfo);
}
+ /**
+ * Log a call to LatinIME.commitCurrentAutoCorrection().
+ *
+ * SystemResponse: The IME has committed an auto-correction. An auto-correction changes the raw
+ * text input to another word that the user more likely desired to type.
+ */
+ private static final LogStatement LOGSTATEMENT_LATINIME_COMMITCURRENTAUTOCORRECTION =
+ new LogStatement("LatinIMECommitCurrentAutoCorrection", true, false, "typedWord",
+ "autoCorrection", "separatorString");
+ public static void latinIme_commitCurrentAutoCorrection(final String typedWord,
+ final String autoCorrection, final String separatorString) {
+ final String scrubbedTypedWord = scrubDigitsFromString(typedWord);
+ final String scrubbedAutoCorrection = scrubDigitsFromString(autoCorrection);
+ final ResearchLogger researchLogger = getInstance();
+ researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_COMMITCURRENTAUTOCORRECTION,
+ scrubbedTypedWord, scrubbedAutoCorrection, separatorString);
+ researchLogger.onWordComplete(scrubbedAutoCorrection, Long.MAX_VALUE,
+ false /* isPartial */);
+ }
+
private boolean isExpectingCommitText = false;
public static void latinIME_commitPartialText(final CharSequence committedWord,
final long lastTimestampOfWordData) {
@@ -1265,9 +1285,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
final ResearchLogger researchLogger = getInstance();
final String scrubbedWord = scrubDigitsFromString(committedWord.toString());
if (!researchLogger.isExpectingCommitText) {
- researchLogger.onWordComplete(scrubbedWord, Long.MAX_VALUE, false /* isPartial */);
researchLogger.enqueueEvent(LOGSTATEMENT_RICHINPUTCONNECTIONCOMMITTEXT,
newCursorPosition);
+ researchLogger.onWordComplete(scrubbedWord, Long.MAX_VALUE, false /* isPartial */);
}
researchLogger.isExpectingCommitText = false;
}