From 99931201d0258ec93bd47de6f6f53ad59709bd85 Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Thu, 10 Jan 2013 14:40:29 -0800 Subject: [Rlog59b] Log CodeInput and KeyCode properly - Fix function calls to happen at more resilient times - In the case of phantom spaces, ensure that the logStatement goes to the correct logUnit Change-Id: Ida8f6eba1e4f33d9f9b4735316e3c6316ed316c0 --- .../inputmethod/research/ResearchLogger.java | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/research/ResearchLogger.java') diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index 5c44af1f2..edf3976dd 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -1175,9 +1175,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang /** * Log a call to LatinIME.sendKeyCodePoint(). * - * SystemResponse: The IME is simulating a hardware keypress. This happens for numbers; other - * input typically goes through RichInputConnection.setComposingText() and - * RichInputConnection.commitText(). + * SystemResponse: The IME is inserting text into the TextView for numbers, fixed strings, or + * some other unusual mechanism. */ private static final LogStatement LOGSTATEMENT_LATINIME_SENDKEYCODEPOINT = new LogStatement("LatinIMESendKeyCodePoint", true, false, "code"); @@ -1190,6 +1189,24 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang } } + /** + * Log a call to LatinIME.promotePhantomSpace(). + * + * SystemResponse: The IME is inserting a real space in place of a phantom space. + */ + private static final LogStatement LOGSTATEMENT_LATINIME_PROMOTEPHANTOMSPACE = + new LogStatement("LatinIMEPromotPhantomSpace", false, false); + public static void latinIME_promotePhantomSpace() { + final ResearchLogger researchLogger = getInstance(); + final LogUnit logUnit; + if (researchLogger.mMainLogBuffer == null) { + logUnit = researchLogger.mCurrentLogUnit; + } else { + logUnit = researchLogger.mMainLogBuffer.peekLastLogUnit(); + } + researchLogger.enqueueEvent(logUnit, LOGSTATEMENT_LATINIME_PROMOTEPHANTOMSPACE); + } + /** * Log a call to LatinIME.swapSwapperAndSpace(). * -- cgit v1.2.3-83-g751a