aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/MainKeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java50
1 files changed, 6 insertions, 44 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 86036ccc1..95258ccdc 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -52,17 +52,12 @@ import com.android.inputmethod.keyboard.internal.NonDistinctMultitouchHelper;
import com.android.inputmethod.keyboard.internal.SlidingKeyInputDrawingPreview;
import com.android.inputmethod.keyboard.internal.TimerHandler;
import com.android.inputmethod.latin.Constants;
-import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SuggestedWords;
-import com.android.inputmethod.latin.define.ProductionFlag;
import com.android.inputmethod.latin.settings.DebugSettings;
-import com.android.inputmethod.latin.utils.CollectionUtils;
import com.android.inputmethod.latin.utils.CoordinateUtils;
import com.android.inputmethod.latin.utils.SpacebarLanguageUtils;
import com.android.inputmethod.latin.utils.TypefaceUtils;
-import com.android.inputmethod.latin.utils.UsabilityStudyLogUtils;
-import com.android.inputmethod.research.ResearchLogger;
import java.util.WeakHashMap;
@@ -150,8 +145,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
private final Paint mBackgroundDimAlphaPaint = new Paint();
private boolean mNeedsToDimEntireKeyboard;
private final View mMoreKeysKeyboardContainer;
- private final WeakHashMap<Key, Keyboard> mMoreKeysKeyboardCache =
- CollectionUtils.newWeakHashMap();
+ private final WeakHashMap<Key, Keyboard> mMoreKeysKeyboardCache = new WeakHashMap<>();
private final boolean mConfigShowMoreKeysKeyboardAtTouchedPoint;
// More keys panel (used by both more keys keyboard and more suggestions view)
// TODO: Consider extending to support multiple more keys panels
@@ -389,10 +383,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
mSpaceKey = keyboard.getKey(Constants.CODE_SPACE);
final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
mLanguageOnSpacebarTextSize = keyHeight * mLanguageOnSpacebarTextRatio;
- if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
- final int orientation = getContext().getResources().getConfiguration().orientation;
- ResearchLogger.mainKeyboardView_setKeyboard(keyboard, orientation);
- }
mAccessibilityDelegate.setKeyboard(keyboard);
}
@@ -554,24 +544,12 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
protected void onAttachedToWindow() {
super.onAttachedToWindow();
installPreviewPlacerView();
- // Notify the ResearchLogger (development only diagnostics) that the keyboard view has
- // been attached. This is needed to properly show the splash screen, which requires that
- // the window token of the KeyboardView be non-null.
- if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
- ResearchLogger.getInstance().mainKeyboardView_onAttachedToWindow(this);
- }
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mDrawingPreviewPlacerView.removeAllViews();
- // Notify the ResearchLogger (development only diagnostics) that the keyboard view has
- // been detached. This is needed to invalidate the reference of {@link MainKeyboardView}
- // to null.
- if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
- ResearchLogger.getInstance().mainKeyboardView_onDetachedFromWindow();
- }
}
private MoreKeysPanel onCreateMoreKeysPanel(final Key key, final Context context) {
@@ -607,9 +585,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
if (key == null) {
return;
}
- if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
- ResearchLogger.mainKeyboardView_onLongPress();
- }
final KeyboardActionListener listener = mKeyboardActionListener;
if (key.hasNoPanelAutoMoreKey()) {
final int moreKeyCode = key.getMoreKeys()[0].mCode;
@@ -722,14 +697,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
}
public boolean processMotionEvent(final MotionEvent me) {
- if (LatinImeLogger.sUsabilityStudy) {
- UsabilityStudyLogUtils.writeMotionEvent(me);
- }
- // Currently the same "move" event is being logged twice.
- if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
- ResearchLogger.mainKeyboardView_processMotionEvent(me);
- }
-
final int index = me.getActionIndex();
final int id = me.getPointerId(index);
final PointerTracker tracker = PointerTracker.getPointerTracker(id);
@@ -765,19 +732,14 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
}
/**
- * Receives hover events from the input framework.
- *
- * @param event The motion event to be dispatched.
- * @return {@code true} if the event was handled by the view, {@code false}
- * otherwise
+ * {@inheritDoc}
*/
@Override
- public boolean dispatchHoverEvent(final MotionEvent event) {
- if (!AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
- // Reflection doesn't support calling superclass methods.
- return false;
+ public boolean onHoverEvent(final MotionEvent event) {
+ if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
+ return mAccessibilityDelegate.onHoverEvent(event);
}
- return mAccessibilityDelegate.dispatchHoverEvent(event);
+ return super.onHoverEvent(event);
}
public void updateShortcutKey(final boolean available) {