From 211103d7fecc3d6df116ec677ae88cb6d70cce86 Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Wed, 24 Oct 2012 10:49:30 -0700 Subject: [PATCH] [Rlog58a] Fix privacy leak of word in logUnitStart Change-Id: Idcea4cd0256581e9868ac987fd1fa281ff074483 --- java/src/com/android/inputmethod/research/LogUnit.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java/src/com/android/inputmethod/research/LogUnit.java b/java/src/com/android/inputmethod/research/LogUnit.java index 7b45ff175..cfba28909 100644 --- a/java/src/com/android/inputmethod/research/LogUnit.java +++ b/java/src/com/android/inputmethod/research/LogUnit.java @@ -133,7 +133,7 @@ import java.util.Map; // will not have been opened for writing. if (jsonWriter == null) { jsonWriter = researchLog.getValidJsonWriterLocked(); - outputLogUnitStart(jsonWriter); + outputLogUnitStart(jsonWriter, isIncludingPrivateData); } outputLogStatementToLocked(jsonWriter, mLogStatementList.get(i), mValuesList.get(i), mTimeList.get(i)); @@ -169,11 +169,14 @@ import java.util.Map; private static final String LOG_UNIT_BEGIN_KEY = "logUnitStart"; private static final String LOG_UNIT_END_KEY = "logUnitEnd"; - private void outputLogUnitStart(final JsonWriter jsonWriter) { + private void outputLogUnitStart(final JsonWriter jsonWriter, + final boolean isIncludingPrivateData) { try { jsonWriter.beginObject(); jsonWriter.name(CURRENT_TIME_KEY).value(System.currentTimeMillis()); - jsonWriter.name(WORD_KEY).value(getWord()); + if (isIncludingPrivateData) { + jsonWriter.name(WORD_KEY).value(getWord()); + } jsonWriter.name(EVENT_TYPE_KEY).value(LOG_UNIT_BEGIN_KEY); jsonWriter.endObject(); } catch (IOException e) {