diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index cdf07ed..973f64b 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -383,6 +383,7 @@
         case CODE_ACTION_ENTER: return "actionEnter";
         case CODE_ACTION_NEXT: return "actionNext";
         case CODE_ACTION_PREVIOUS: return "actionPrevious";
+        case CODE_LANGUAGE_SWITCH: return "languageSwitch";
         case CODE_UNSPECIFIED: return "unspec";
         case CODE_TAB: return "tab";
         case CODE_ENTER: return "enter";
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index 97f4d07..3438425 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -84,7 +84,7 @@
     private static final int ALPHA_OPAQUE = 255;
     private boolean mNeedsToDisplayLanguage;
     private Locale mSpacebarLocale;
-    private int mSpacebarTextAlpha;
+    private int mSpacebarTextAlpha = ALPHA_OPAQUE;
     private final float mSpacebarTextRatio;
     private float mSpacebarTextSize;
     private final int mSpacebarTextColor;
@@ -101,7 +101,7 @@
     // Stuff to draw altCodeWhileTyping keys.
     private ValueAnimator mAltCodeKeyWhileTypingFadeoutAnimator;
     private ValueAnimator mAltCodeKeyWhileTypingFadeinAnimator;
-    private int mAltCodeKeyWhileTypingAnimAlpha;
+    private int mAltCodeKeyWhileTypingAnimAlpha = ALPHA_OPAQUE;
 
     // More keys keyboard
     private PopupWindow mMoreKeysWindow;
@@ -154,16 +154,8 @@
                 }
                 break;
             case MSG_TYPING_STATE_EXPIRED:
-                final ValueAnimator fadeout = keyboardView.mAltCodeKeyWhileTypingFadeoutAnimator;
-                if (fadeout != null && fadeout.isStarted()) {
-                    fadeout.cancel();
-                }
-                // TODO: Start the fade in animation with an initial value that is the same as the
-                // final value when the above fade out animation gets cancelled.
-                final ValueAnimator fadein = keyboardView.mAltCodeKeyWhileTypingFadeinAnimator;
-                if (fadein != null && !fadein.isStarted()) {
-                    fadein.start();
-                }
+                cancelAndStartAnimators(keyboardView.mAltCodeKeyWhileTypingFadeoutAnimator,
+                        keyboardView.mAltCodeKeyWhileTypingFadeinAnimator);
                 break;
             }
         }
@@ -238,26 +230,34 @@
             removeMessages(MSG_LONGPRESS_KEY);
         }
 
+        private static void cancelAndStartAnimators(ValueAnimator animatorToCancel,
+                ValueAnimator animatorToStart) {
+            if (animatorToCancel != null && animatorToCancel.isStarted()) {
+                animatorToCancel.cancel();
+            }
+            // TODO: Start the animation with an initial value that is the same as the final value
+            // of the above animation when it gets cancelled.
+            if (animatorToStart != null && !animatorToStart.isStarted()) {
+                animatorToStart.start();
+            }
+        }
+
+        private void cancelTypingStateTimer() {
+            removeMessages(MSG_TYPING_STATE_EXPIRED);
+        }
+
         @Override
         public void startTypingStateTimer() {
             final boolean isTyping = isTypingState();
-            removeMessages(MSG_TYPING_STATE_EXPIRED);
+            cancelTypingStateTimer();
             sendMessageDelayed(
                     obtainMessage(MSG_TYPING_STATE_EXPIRED), mParams.mIgnoreAltCodeKeyTimeout);
-            final LatinKeyboardView keyboardView = getOuterInstance();
             if (isTyping) {
                 return;
             }
-            final ValueAnimator fadein = keyboardView.mAltCodeKeyWhileTypingFadeinAnimator;
-            if (fadein != null && fadein.isStarted()) {
-                fadein.cancel();
-            }
-            // TODO: Start the fade out animation with an initial value that is the same as the
-            // final value when the above fade in animation gets cancelled.
-            final ValueAnimator fadeout = keyboardView.mAltCodeKeyWhileTypingFadeoutAnimator;
-            if (fadeout != null && !fadeout.isStarted()) {
-                fadeout.start();
-            }
+            final LatinKeyboardView keyboardView = getOuterInstance();
+            cancelAndStartAnimators(keyboardView.mAltCodeKeyWhileTypingFadeinAnimator,
+                    keyboardView.mAltCodeKeyWhileTypingFadeoutAnimator);
         }
 
         @Override
@@ -289,6 +289,7 @@
 
         public void cancelAllMessages() {
             cancelKeyTimers();
+            cancelTypingStateTimer();
         }
     }
 
@@ -323,15 +324,6 @@
         public final int mLongPressSpaceKeyTimeout;
         public final int mIgnoreAltCodeKeyTimeout;
 
-        KeyTimerParams() {
-            mKeyRepeatStartTimeout = 0;
-            mKeyRepeatInterval = 0;
-            mLongPressKeyTimeout = 0;
-            mLongPressShiftKeyTimeout = 0;
-            mLongPressSpaceKeyTimeout = 0;
-            mIgnoreAltCodeKeyTimeout = 0;
-        }
-
         public KeyTimerParams(TypedArray latinKeyboardViewAttr) {
             mKeyRepeatStartTimeout = latinKeyboardViewAttr.getInt(
                     R.styleable.LatinKeyboardView_keyRepeatStartTimeout, 0);
@@ -424,12 +416,6 @@
                     updateAltCodeKeyWhileTyping();
                 }
             });
-            fadeout.addListener(new AnimatorListenerAdapter() {
-                @Override
-                public void onAnimationEnd(Animator a) {
-                    final ValueAnimator valueAnimator = (ValueAnimator)a;
-                }
-            });
         }
         mAltCodeKeyWhileTypingFadeoutAnimator = fadeout;
 
@@ -442,12 +428,6 @@
                     updateAltCodeKeyWhileTyping();
                 }
             });
-            fadein.addListener(new AnimatorListenerAdapter() {
-                @Override
-                public void onAnimationEnd(Animator a) {
-                    final ValueAnimator valueAnimator = (ValueAnimator)a;
-                }
-            });
         }
         mAltCodeKeyWhileTypingFadeinAnimator = fadein;
     }
@@ -510,8 +490,6 @@
         final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
         mSpacebarTextSize = keyHeight * mSpacebarTextRatio;
         mSpacebarLocale = keyboard.mId.mLocale;
-        mSpacebarTextAlpha = ALPHA_OPAQUE;
-        mAltCodeKeyWhileTypingAnimAlpha = ALPHA_OPAQUE;
     }
 
     /**
