am 058f37f8: Merge "Cosmetic code optimization"

* commit '058f37f8badf646928cfa099240e612c4be76077':
  Cosmetic code optimization
main
Tadashi G. Takaoka 2013-07-25 00:30:39 -07:00 committed by Android Git Automerger
commit 522707adb5
2 changed files with 3 additions and 9 deletions

View File

@ -29,7 +29,6 @@ import android.view.inputmethod.EditorInfo;
import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy; import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy;
import com.android.inputmethod.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException; import com.android.inputmethod.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException;
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
import com.android.inputmethod.keyboard.internal.KeyboardState; import com.android.inputmethod.keyboard.internal.KeyboardState;
import com.android.inputmethod.latin.InputView; import com.android.inputmethod.latin.InputView;
import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinIME;
@ -274,8 +273,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
public void startDoubleTapShiftKeyTimer() { public void startDoubleTapShiftKeyTimer() {
final MainKeyboardView keyboardView = getMainKeyboardView(); final MainKeyboardView keyboardView = getMainKeyboardView();
if (keyboardView != null) { if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy(); keyboardView.getTimerProxy().startDoubleTapShiftKeyTimer();
timer.startDoubleTapShiftKeyTimer();
} }
} }
@ -284,8 +282,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
public void cancelDoubleTapShiftKeyTimer() { public void cancelDoubleTapShiftKeyTimer() {
final MainKeyboardView keyboardView = getMainKeyboardView(); final MainKeyboardView keyboardView = getMainKeyboardView();
if (keyboardView != null) { if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy(); keyboardView.getTimerProxy().cancelDoubleTapShiftKeyTimer();
timer.cancelDoubleTapShiftKeyTimer();
} }
} }
@ -293,8 +290,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
@Override @Override
public boolean isInDoubleTapShiftKeyTimeout() { public boolean isInDoubleTapShiftKeyTimeout() {
final MainKeyboardView keyboardView = getMainKeyboardView(); final MainKeyboardView keyboardView = getMainKeyboardView();
return (keyboardView != null) return keyboardView != null && keyboardView.getTimerProxy().isInDoubleTapShiftKeyTimeout();
? keyboardView.getTimerProxy().isInDoubleTapShiftKeyTimeout() : false;
} }
/** /**

View File

@ -775,8 +775,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
private static final int STATE_RIGHT = 2; private static final int STATE_RIGHT = 2;
private static final int STATE_NORMAL = 0; private static final int STATE_NORMAL = 0;
private static final int STATE_HAS_MOREKEYS = 1; private static final int STATE_HAS_MOREKEYS = 1;
private static final int[] KEY_PREVIEW_BACKGROUND_DEFAULT_STATE =
KEY_PREVIEW_BACKGROUND_STATE_TABLE[STATE_MIDDLE][STATE_NORMAL];
@Override @Override
public void showKeyPreview(final PointerTracker tracker) { public void showKeyPreview(final PointerTracker tracker) {