aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/research/ResearchLogger.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-08-21 15:11:02 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-08-22 12:14:52 +0900
commitc3f78c9057a5710898feaf8027659484477e5821 (patch)
tree5ebc9f2180284573e91832c386781aba25663e30 /java/src/com/android/inputmethod/research/ResearchLogger.java
parenteb59a87a074348d30191e57308221531ae613001 (diff)
downloadlatinime-c3f78c9057a5710898feaf8027659484477e5821.tar.gz
latinime-c3f78c9057a5710898feaf8027659484477e5821.tar.xz
latinime-c3f78c9057a5710898feaf8027659484477e5821.zip
Remove KeyboardSwitcher reference from ResearchLogger
Change-Id: I671a83c19977fda358c8e8a730e22ee155f65512
Diffstat (limited to 'java/src/com/android/inputmethod/research/ResearchLogger.java')
-rw-r--r--java/src/com/android/inputmethod/research/ResearchLogger.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java
index 2b2735060..09a22eff1 100644
--- a/java/src/com/android/inputmethod/research/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/research/ResearchLogger.java
@@ -54,7 +54,6 @@ import android.widget.Toast;
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.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.latin.CollectionUtils;
@@ -138,7 +137,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
// used to check whether words are not unique
private Suggest mSuggest;
private Dictionary mDictionary;
- private KeyboardSwitcher mKeyboardSwitcher;
+ private MainKeyboardView mMainKeyboardView;
private InputMethodService mInputMethodService;
private final Statistics mStatistics;
@@ -152,8 +151,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
return sInstance;
}
- public void init(final InputMethodService ims, final SharedPreferences prefs,
- KeyboardSwitcher keyboardSwitcher) {
+ public void init(final InputMethodService ims, final SharedPreferences prefs) {
assert ims != null;
if (ims == null) {
Log.w(TAG, "IMS is null; logging is off");
@@ -185,7 +183,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
mResearchLogUploader = new ResearchLogUploader(ims, mFilesDir);
mResearchLogUploader.start();
- mKeyboardSwitcher = keyboardSwitcher;
mInputMethodService = ims;
mPrefs = prefs;
}
@@ -199,10 +196,15 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
}
- public void mainKeyboardView_onAttachedToWindow() {
+ public void mainKeyboardView_onAttachedToWindow(final MainKeyboardView mainKeyboardView) {
+ mMainKeyboardView = mainKeyboardView;
maybeShowSplashScreen();
}
+ public void mainKeyboardView_onDetachedFromWindow() {
+ mMainKeyboardView = null;
+ }
+
private boolean hasSeenSplash() {
return mPrefs.getBoolean(PREF_RESEARCH_HAS_SEEN_SPLASH, false);
}
@@ -216,7 +218,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
if (mSplashDialog != null && mSplashDialog.isShowing()) {
return;
}
- final IBinder windowToken = mKeyboardSwitcher.getMainKeyboardView().getWindowToken();
+ final IBinder windowToken = mMainKeyboardView != null
+ ? mMainKeyboardView.getWindowToken() : null;
if (windowToken == null) {
return;
}
@@ -593,14 +596,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
if (!IS_SHOWING_INDICATOR) {
return;
}
- if (mKeyboardSwitcher == null) {
- return;
- }
- final KeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
- if (mainKeyboardView == null) {
+ if (mMainKeyboardView == null) {
return;
}
- mainKeyboardView.invalidateAllKeys();
+ mMainKeyboardView.invalidateAllKeys();
}