am 1e55e59c: Merge "[Rlog4] ResearchLogger add LOG_EVERYTHING flag"

* commit '1e55e59cc966d2525b88501f373d09993f368567':
  [Rlog4] ResearchLogger add LOG_EVERYTHING flag
main
Kurt Partridge 2012-12-18 10:47:46 -08:00 committed by Android Git Automerger
commit 9206b0ade5
2 changed files with 10 additions and 5 deletions

View File

@ -119,6 +119,10 @@ public class MainLogBuffer extends LogBuffer {
} else { } else {
// Words not in the dictionary are a privacy threat. // Words not in the dictionary are a privacy threat.
if (ResearchLogger.hasLetters(word) && !(dictionary.isValidWord(word))) { if (ResearchLogger.hasLetters(word) && !(dictionary.isValidWord(word))) {
if (DEBUG) {
Log.d(TAG, "NOT SAFE!: hasLetters: " + ResearchLogger.hasLetters(word)
+ ", isValid: " + (dictionary.isValidWord(word)));
}
return false; return false;
} }
} }

View File

@ -84,7 +84,7 @@ import java.util.UUID;
public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener { public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = ResearchLogger.class.getSimpleName(); private static final String TAG = ResearchLogger.class.getSimpleName();
private static final boolean DEBUG = false; private static final boolean DEBUG = false;
private static final boolean OUTPUT_ENTIRE_BUFFER = false; // true may disclose private info private static final boolean LOG_EVERYTHING = false; // true will disclose private info
public static final boolean DEFAULT_USABILITY_STUDY_MODE = false; public static final boolean DEFAULT_USABILITY_STUDY_MODE = false;
/* package */ static boolean sIsLogging = false; /* package */ static boolean sIsLogging = false;
private static final int OUTPUT_FORMAT_VERSION = 5; private static final int OUTPUT_FORMAT_VERSION = 5;
@ -379,7 +379,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
commitCurrentLogUnit(); commitCurrentLogUnit();
if (mMainLogBuffer != null) { if (mMainLogBuffer != null) {
publishLogBuffer(mMainLogBuffer, mMainResearchLog, false /* isIncludingPrivateData */); publishLogBuffer(mMainLogBuffer, mMainResearchLog,
LOG_EVERYTHING /* isIncludingPrivateData */);
mMainResearchLog.close(null /* callback */); mMainResearchLog.close(null /* callback */);
mMainLogBuffer = null; mMainLogBuffer = null;
} }
@ -795,7 +796,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
private static final LogStatement LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL = private static final LogStatement LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL =
new LogStatement("LatinImeOnStartInputViewInternal", false, false, "uuid", new LogStatement("LatinImeOnStartInputViewInternal", false, false, "uuid",
"packageName", "inputType", "imeOptions", "fieldId", "display", "model", "packageName", "inputType", "imeOptions", "fieldId", "display", "model",
"prefs", "versionCode", "versionName", "outputFormatVersion"); "prefs", "versionCode", "versionName", "outputFormatVersion", "logEverything");
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo, public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,
final SharedPreferences prefs) { final SharedPreferences prefs) {
final ResearchLogger researchLogger = getInstance(); final ResearchLogger researchLogger = getInstance();
@ -816,7 +817,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
Integer.toHexString(editorInfo.inputType), Integer.toHexString(editorInfo.inputType),
Integer.toHexString(editorInfo.imeOptions), editorInfo.fieldId, Integer.toHexString(editorInfo.imeOptions), editorInfo.fieldId,
Build.DISPLAY, Build.MODEL, prefs, versionCode, versionName, Build.DISPLAY, Build.MODEL, prefs, versionCode, versionName,
OUTPUT_FORMAT_VERSION); OUTPUT_FORMAT_VERSION, LOG_EVERYTHING);
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -896,7 +897,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
if (ic != null) { if (ic != null) {
final boolean isTextTruncated; final boolean isTextTruncated;
final String text; final String text;
if (OUTPUT_ENTIRE_BUFFER) { if (LOG_EVERYTHING) {
// Capture the TextView contents. This will trigger onUpdateSelection(), so we // Capture the TextView contents. This will trigger onUpdateSelection(), so we
// set sLatinIMEExpectingUpdateSelection so that when onUpdateSelection() is called, // set sLatinIMEExpectingUpdateSelection so that when onUpdateSelection() is called,
// it can tell that it was generated by the logging code, and not by the user, and // it can tell that it was generated by the logging code, and not by the user, and