From 6b966160ac8570271547bf63217efa5e228d4acc Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Fri, 20 Jul 2012 11:02:39 -0700 Subject: [PATCH] ResearchLog refactor - new package: com.android.inputmethod.research multi-project commit with Ic0a5744f3160d13218addd589890623c0d120ffc Bug: 6188932 Change-Id: Icf8d4a40a5725401799be6e209a640d99a5f34c4 --- java/proguard.flags | 2 +- .../inputmethod/keyboard/LatinKeyboardView.java | 2 +- .../inputmethod/keyboard/PointerTracker.java | 2 +- .../keyboard/SuddenJumpingTouchEventHandler.java | 2 +- .../com/android/inputmethod/latin/LatinIME.java | 3 ++- .../inputmethod/latin/RichInputConnection.java | 1 + .../com/android/inputmethod/latin/Settings.java | 1 + .../latin/suggestions/SuggestionsView.java | 2 +- .../{latin => research}/ResearchLog.java | 5 +++-- .../{latin => research}/ResearchLogger.java | 14 ++++++++++---- 10 files changed, 22 insertions(+), 12 deletions(-) rename java/src/com/android/inputmethod/{latin => research}/ResearchLog.java (98%) rename java/src/com/android/inputmethod/{latin => research}/ResearchLogger.java (98%) diff --git a/java/proguard.flags b/java/proguard.flags index 1711b99df..b66c9a91c 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -44,7 +44,7 @@ (...); } --keep class com.android.inputmethod.latin.ResearchLogger { +-keep class com.android.inputmethod.research.ResearchLogger { void flush(); void publishCurrentLogUnit(...); } diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index 537b4e245..cf196638d 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -47,13 +47,13 @@ import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResearchLogger; import com.android.inputmethod.latin.StaticInnerHandlerWrapper; import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SubtypeLocale; import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger; import java.util.Locale; import java.util.WeakHashMap; diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 1c84cb947..fb795f2cd 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -30,8 +30,8 @@ import com.android.inputmethod.keyboard.internal.GestureStroke; import com.android.inputmethod.keyboard.internal.PointerTrackerQueue; import com.android.inputmethod.latin.InputPointers; import com.android.inputmethod.latin.LatinImeLogger; -import com.android.inputmethod.latin.ResearchLogger; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/keyboard/SuddenJumpingTouchEventHandler.java b/java/src/com/android/inputmethod/keyboard/SuddenJumpingTouchEventHandler.java index 107138395..617207389 100644 --- a/java/src/com/android/inputmethod/keyboard/SuddenJumpingTouchEventHandler.java +++ b/java/src/com/android/inputmethod/keyboard/SuddenJumpingTouchEventHandler.java @@ -22,9 +22,9 @@ import android.view.MotionEvent; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResearchLogger; import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger; public class SuddenJumpingTouchEventHandler { private static final String TAG = SuddenJumpingTouchEventHandler.class.getSimpleName(); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 63aed7f58..8953cb8d1 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -71,6 +71,7 @@ import com.android.inputmethod.keyboard.LatinKeyboardView; import com.android.inputmethod.latin.LocaleUtils.RunInLocale; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.suggestions.SuggestionsView; +import com.android.inputmethod.research.ResearchLogger; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -2159,7 +2160,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen showOptionDialog(builder.create()); } - /* package */ void showOptionDialog(AlertDialog dialog) { + public void showOptionDialog(AlertDialog dialog) { final IBinder windowToken = mKeyboardSwitcher.getKeyboardView().getWindowToken(); if (windowToken == null) return; diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 5786978a8..8b4c17322 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -28,6 +28,7 @@ import android.view.inputmethod.InputConnection; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger; import java.util.regex.Pattern; diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index b67cc852e..45608f439 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -39,6 +39,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger; import com.android.inputmethodcommon.InputMethodSettingsFragment; public class Settings extends InputMethodSettingsFragment diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java index 4d33f4ba5..52ceb8698 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java @@ -60,11 +60,11 @@ import com.android.inputmethod.keyboard.ViewLayoutUtils; import com.android.inputmethod.latin.AutoCorrection; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResearchLogger; import com.android.inputmethod.latin.StaticInnerHandlerWrapper; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/ResearchLog.java b/java/src/com/android/inputmethod/research/ResearchLog.java similarity index 98% rename from java/src/com/android/inputmethod/latin/ResearchLog.java rename to java/src/com/android/inputmethod/research/ResearchLog.java index 917ee84a2..18bf3c07f 100644 --- a/java/src/com/android/inputmethod/latin/ResearchLog.java +++ b/java/src/com/android/inputmethod/research/ResearchLog.java @@ -14,7 +14,7 @@ * the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.research; import android.content.SharedPreferences; import android.os.SystemClock; @@ -23,9 +23,10 @@ import android.util.Log; import android.view.inputmethod.CompletionInfo; import com.android.inputmethod.keyboard.Key; -import com.android.inputmethod.latin.ResearchLogger.LogUnit; +import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.research.ResearchLogger.LogUnit; import java.io.BufferedWriter; import java.io.File; diff --git a/java/src/com/android/inputmethod/latin/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java similarity index 98% rename from java/src/com/android/inputmethod/latin/ResearchLogger.java rename to java/src/com/android/inputmethod/research/ResearchLogger.java index e409c5a08..e27e84f53 100644 --- a/java/src/com/android/inputmethod/latin/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -14,7 +14,7 @@ * the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.research; import static com.android.inputmethod.latin.Constants.Subtype.ExtraValue.KEYBOARD_LAYOUT_SET; @@ -40,7 +40,13 @@ import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardSwitcher; +import com.android.inputmethod.latin.Dictionary; +import com.android.inputmethod.latin.LatinIME; +import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.RichInputConnection; import com.android.inputmethod.latin.RichInputConnection.Range; +import com.android.inputmethod.latin.Suggest; +import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.define.ProductionFlag; import java.io.File; @@ -63,7 +69,7 @@ import java.util.UUID; public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = ResearchLogger.class.getSimpleName(); private static final boolean OUTPUT_ENTIRE_BUFFER = false; // true may disclose private info - /* package */ static final boolean DEFAULT_USABILITY_STUDY_MODE = false; + public static final boolean DEFAULT_USABILITY_STUDY_MODE = false; /* package */ static boolean sIsLogging = false; private static final int OUTPUT_FORMAT_VERSION = 1; private static final String PREF_USABILITY_STUDY_MODE = "usability_study_mode"; @@ -314,7 +320,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang requestIndicatorRedraw(); } - /* package */ void presentResearchDialog(final LatinIME latinIME) { + public void presentResearchDialog(final LatinIME latinIME) { final CharSequence title = latinIME.getString(R.string.english_ime_research_log); final boolean showEnable = mIsLoggingSuspended || !sIsLogging; final CharSequence[] items = new CharSequence[] { @@ -770,7 +776,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang values); } - /* package */ static boolean getAndClearLatinIMEExpectingUpdateSelection() { + public static boolean getAndClearLatinIMEExpectingUpdateSelection() { boolean returnValue = sLatinIMEExpectingUpdateSelection; sLatinIMEExpectingUpdateSelection = false; return returnValue;