From 84ac8f31fbe30f03c14a85ffb8c827edb6e47ab0 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 7 May 2013 16:40:15 +0900 Subject: [PATCH] Move empty listner to KeyboardActionListener.Adapter Change-Id: Ic7bad73c089de015746c667bbfb2c09bd429a9fc --- .../inputmethod/keyboard/KeyboardActionListener.java | 2 ++ .../com/android/inputmethod/keyboard/PointerTracker.java | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardActionListener.java b/java/src/com/android/inputmethod/keyboard/KeyboardActionListener.java index c76acd126..60d09d6fd 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardActionListener.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardActionListener.java @@ -94,6 +94,8 @@ public interface KeyboardActionListener { public boolean onCustomRequest(int requestCode); public static class Adapter implements KeyboardActionListener { + public static final Adapter EMPTY_LISTENER = new Adapter(); + @Override public void onPressKey(int primaryCode) {} @Override diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index c1b148dbf..0556fddd3 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -176,7 +176,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { private DrawingProxy mDrawingProxy; private TimerProxy mTimerProxy; private KeyDetector mKeyDetector; - private KeyboardActionListener mListener = EMPTY_LISTENER; + private KeyboardActionListener mListener = KeyboardActionListener.Adapter.EMPTY_LISTENER; private Keyboard mKeyboard; private int mPhantonSuddenMoveThreshold; @@ -333,10 +333,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element { // true if a sliding key input is allowed. private boolean mIsAllowedSlidingKeyInput; - // Empty {@link KeyboardActionListener} - private static final KeyboardActionListener EMPTY_LISTENER = - new KeyboardActionListener.Adapter(); - private final GestureStrokeWithPreviewPoints mGestureStrokeWithPreviewPoints; public static void init(final boolean needsPhantomSuddenMoveEventHack) {