Loading java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +11 −1 Original line number Diff line number Diff line Loading @@ -528,7 +528,17 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key // to properly show the splash screen, which requires that the window token of the // KeyboardView be non-null. if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.getInstance().mainKeyboardView_onAttachedToWindow(); ResearchLogger.getInstance().mainKeyboardView_onAttachedToWindow(this); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); // Notify the research logger that the keyboard view has been detached. This is needed // to invalidate the reference of {@link MainKeyboardView} to null. if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.getInstance().mainKeyboardView_onDetachedFromWindow(); } } Loading java/src/com/android/inputmethod/latin/LatinIME.java +1 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mPrefs = prefs; LatinImeLogger.init(this, prefs); if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.getInstance().init(this, prefs, mKeyboardSwitcher); ResearchLogger.getInstance().init(this, prefs); } InputMethodManagerCompatWrapper.init(this); SubtypeSwitcher.init(this); Loading java/src/com/android/inputmethod/research/ResearchLogger.java +12 −13 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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"); Loading Loading @@ -185,7 +183,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang } mResearchLogUploader = new ResearchLogUploader(ims, mFilesDir); mResearchLogUploader.start(); mKeyboardSwitcher = keyboardSwitcher; mInputMethodService = ims; mPrefs = prefs; } Loading @@ -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); } Loading @@ -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; } Loading Loading @@ -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(); } Loading Loading
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +11 −1 Original line number Diff line number Diff line Loading @@ -528,7 +528,17 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key // to properly show the splash screen, which requires that the window token of the // KeyboardView be non-null. if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.getInstance().mainKeyboardView_onAttachedToWindow(); ResearchLogger.getInstance().mainKeyboardView_onAttachedToWindow(this); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); // Notify the research logger that the keyboard view has been detached. This is needed // to invalidate the reference of {@link MainKeyboardView} to null. if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.getInstance().mainKeyboardView_onDetachedFromWindow(); } } Loading
java/src/com/android/inputmethod/latin/LatinIME.java +1 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mPrefs = prefs; LatinImeLogger.init(this, prefs); if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.getInstance().init(this, prefs, mKeyboardSwitcher); ResearchLogger.getInstance().init(this, prefs); } InputMethodManagerCompatWrapper.init(this); SubtypeSwitcher.init(this); Loading
java/src/com/android/inputmethod/research/ResearchLogger.java +12 −13 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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"); Loading Loading @@ -185,7 +183,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang } mResearchLogUploader = new ResearchLogUploader(ims, mFilesDir); mResearchLogUploader.start(); mKeyboardSwitcher = keyboardSwitcher; mInputMethodService = ims; mPrefs = prefs; } Loading @@ -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); } Loading @@ -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; } Loading Loading @@ -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(); } Loading