From 0aafbcf879a31afc8361078bd9574915d95694c0 Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Mon, 17 Dec 2012 18:19:58 -0800 Subject: Add ProductionFlag.IS_EXPERIMENTAL_DEBUG The IS_EXPERIMENTAL_DEBUG flag gives a single place to turn off all debugging flags that might be set and to also enforce privacy controls. Currently only used in the research package. multi-project commit with I9275a7c8e40bf56106447a02d3056655329074b3 Change-Id: If769fe3a633f33963ca49e8ddf01ab24a30b6fd2 --- java/src/com/android/inputmethod/research/MainLogBuffer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/research/MainLogBuffer.java') diff --git a/java/src/com/android/inputmethod/research/MainLogBuffer.java b/java/src/com/android/inputmethod/research/MainLogBuffer.java index b027643a1..0185e5fc0 100644 --- a/java/src/com/android/inputmethod/research/MainLogBuffer.java +++ b/java/src/com/android/inputmethod/research/MainLogBuffer.java @@ -20,18 +20,19 @@ import android.util.Log; import com.android.inputmethod.latin.Dictionary; import com.android.inputmethod.latin.Suggest; +import com.android.inputmethod.latin.define.ProductionFlag; import java.util.Random; public class MainLogBuffer extends LogBuffer { private static final String TAG = MainLogBuffer.class.getSimpleName(); - // For privacy reasons, be sure to set to "false" for production code. - private static final boolean DEBUG = false; + private static final boolean DEBUG = false && ProductionFlag.IS_EXPERIMENTAL_DEBUG; // The size of the n-grams logged. E.g. N_GRAM_SIZE = 2 means to sample bigrams. private static final int N_GRAM_SIZE = 2; // The number of words between n-grams to omit from the log. - private static final int DEFAULT_NUMBER_OF_WORDS_BETWEEN_SAMPLES = DEBUG ? 2 : 18; + private static final int DEFAULT_NUMBER_OF_WORDS_BETWEEN_SAMPLES = + ProductionFlag.IS_EXPERIMENTAL_DEBUG ? 2 : 18; private final ResearchLog mResearchLog; private Suggest mSuggest; -- cgit v1.2.3-83-g751a