From 698b19ef35d1d865943ec9d9ee05f8f0e66dc3f8 Mon Sep 17 00:00:00 2001 From: Mohammadinamul Sheik Date: Wed, 13 Aug 2014 17:09:06 -0700 Subject: [PATCH] Pass a new argument to StatsUtils. Change-Id: I61e32c7a455a273e8daf9a5487d7969923802488 Bug: 17013677 --- .../src/com/android/inputmethod/latin/utils/StatsUtils.java | 5 ++++- java/src/com/android/inputmethod/latin/LatinIME.java | 2 +- .../android/inputmethod/latin/RichInputMethodManager.java | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java index 79c19d077..95df202db 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java @@ -17,13 +17,16 @@ package com.android.inputmethod.latin.utils; import android.content.Context; + +import com.android.inputmethod.latin.RichInputMethodManager; import com.android.inputmethod.latin.settings.SettingsValues; public final class StatsUtils { public static void init(final Context context) { } - public static void onCreate(final SettingsValues settingsValues) { + public static void onCreate(final SettingsValues settingsValues, + RichInputMethodManager richImm) { } public static void onLoadSettings(final SettingsValues settingsValues) { diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index b4d6ca736..c44555eb2 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -561,7 +561,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen DictionaryDecayBroadcastReciever.setUpIntervalAlarmForDictionaryDecaying(this); - StatsUtils.onCreate(mSettings.getCurrent()); + StatsUtils.onCreate(mSettings.getCurrent(), mRichImm); } // Has to be package-visible for unit tests diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index 7cf4eff92..e43c18255 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -40,7 +40,8 @@ import java.util.List; /** * Enrichment class for InputMethodManager to simplify interaction and add functionality. */ -public final class RichInputMethodManager { +// non final for easy mocking. +public class RichInputMethodManager { private static final String TAG = RichInputMethodManager.class.getSimpleName(); private RichInputMethodManager() {