diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 3540577..fad12cc 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -67,7 +67,9 @@
 public class Keyboard {
     private static final String TAG = Keyboard.class.getSimpleName();
 
-    /** Some common keys code.  These should be aligned with values/keycodes.xml */
+    /** Some common keys code. Must be positive.
+     * These should be aligned with values/keycodes.xml
+     */
     public static final int CODE_ENTER = '\n';
     public static final int CODE_TAB = '\t';
     public static final int CODE_SPACE = ' ';
@@ -85,7 +87,9 @@
     public static final int CODE_DIGIT0 = '0';
     public static final int CODE_PLUS = '+';
 
-    /** Special keys code.  These should be aligned with values/keycodes.xml */
+    /** Special keys code. Must be non-positive.
+     * These should be aligned with values/keycodes.xml
+     */
     public static final int CODE_DUMMY = 0;
     public static final int CODE_SHIFT = -1;
     public static final int CODE_SWITCH_ALPHA_SYMBOL = -2;
@@ -248,6 +252,10 @@
         return label;
     }
 
+    public static boolean isLetterCode(int code) {
+        return code > CODE_DUMMY;
+    }
+
     public static class Params {
         public KeyboardId mId;
         public int mThemeId;
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index fa073b6..e509715 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -332,7 +332,7 @@
      * Updates state machine to figure out when to automatically snap back to the previous mode.
      */
     public void onCodeInput(int code) {
-        mState.onCodeInput(code, isSinglePointer());
+        mState.onCodeInput(code, isSinglePointer(), mInputMethodService.getCurrentAutoCapsState());
     }
 
     public LatinKeyboardView getKeyboardView() {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 623cab3..c0adf97 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -29,9 +29,10 @@
  *
  * The input events are {@link #onLoadKeyboard(String, boolean)}, {@link #onSaveKeyboardState()},
  * {@link #onPressShift(boolean)}, {@link #onReleaseShift(boolean)}, {@link #onPressSymbol()},
- * {@link #onReleaseSymbol()}, {@link #onOtherKeyPressed()}, {@link #onCodeInput(int, boolean)},
- * {@link #onCancelInput(boolean)}, {@link #onUpdateShiftState(boolean)}, {@link #onToggleShift()},
- * {@link #onToggleCapsLock()}, and {@link #onToggleAlphabetAndSymbols()}.
+ * {@link #onReleaseSymbol()}, {@link #onOtherKeyPressed()},
+ * {@link #onCodeInput(int, boolean, boolean)}, {@link #onCancelInput(boolean)},
+ * {@link #onUpdateShiftState(boolean)}, {@link #onToggleShift()}, {@link #onToggleCapsLock()},
+ * and {@link #onToggleAlphabetAndSymbols()}.
  *
  * The actions are {@link SwitchActions}'s methods.
  */
@@ -267,6 +268,10 @@
         if (DEBUG_STATE) {
             Log.d(TAG, "onUpdateShiftState: autoCaps=" + autoCaps + " " + this);
         }
+        onUpdateShiftStateInternal(autoCaps);
+    }
+
+    private void onUpdateShiftStateInternal(boolean autoCaps) {
         if (mIsAlphabetMode) {
             if (!mKeyboardShiftState.isShiftLocked() && !mShiftKeyState.isIgnoring()) {
                 if (mShiftKeyState.isReleasing() && autoCaps) {
@@ -381,10 +386,10 @@
         return false;
     }
 
-    public void onCodeInput(int code, boolean isSinglePointer) {
+    public void onCodeInput(int code, boolean isSinglePointer, boolean autoCaps) {
         if (DEBUG_STATE) {
             Log.d(TAG, "onCodeInput: code=" + code + " isSinglePointer=" + isSinglePointer
-                    + " " + this);
+                    + " autoCaps=" + autoCaps + " " + this);
         }
         switch (mSwitchState) {
         case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL:
@@ -446,6 +451,11 @@
             }
             break;
         }
+
+        // If the code is a letter, update keyboard shift state.
+        if (Keyboard.isLetterCode(code)) {
+            onUpdateShiftStateInternal(autoCaps);
+        }
     }
 
     public void onToggleShift() {
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index d2b1e9b..e6478b6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1496,7 +1496,6 @@
             if (null != ic) swapSwapperAndSpaceWhileInBatchEdit(ic);
         }
 
-        switcher.updateShiftState();
         if (mSettingsValues.isWordSeparator(code)) {
             Utils.Stats.onSeparator((char)code, x, y);
         } else {
@@ -1581,7 +1580,6 @@
 
         Utils.Stats.onSeparator((char)primaryCode, x, y);
 
-        mKeyboardSwitcher.updateShiftState();
         if (ic != null) {
             ic.endBatchEdit();
         }
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java
index 3cd6a89..1f6141e 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java
@@ -90,7 +90,8 @@
     // Argument for KeyboardState.onCodeInput.
     private static final boolean SINGLE = true;
     private static final boolean MULTI = false;
-
+    private static final boolean NO_AUTO_CAPS = false;
+    private static final boolean AUTO_CAPS = true;
 
     private void assertAlphabetNormal() {
         assertEquals(ALPHABET_UNSHIFTED, mSwitcher.mLayout);
@@ -213,7 +214,7 @@
         // Long press recognized in LatinKeyboardView.KeyTimerHandler.
         mState.onToggleCapsLock();
         assertAlphabetShiftLocked();
-        mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE);
+        mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE, NO_AUTO_CAPS);
         assertAlphabetShiftLocked();
         mState.onReleaseShift(NOT_SLIDING);
         assertAlphabetShiftLocked();
@@ -224,7 +225,7 @@
         // Long press recognized in LatinKeyboardView.KeyTimerHandler.
         mState.onToggleCapsLock();
         assertAlphabetNormal();
-        mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE);
+        mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE, NO_AUTO_CAPS);
         assertAlphabetNormal();
         mState.onReleaseShift(NOT_SLIDING);
         assertAlphabetNormal();
@@ -236,7 +237,7 @@
         // First shift key tap.
         mState.onPressShift(NOT_SLIDING);
         assertAlphabetManualShifted();
-        mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE);
+        mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE, NO_AUTO_CAPS);
         assertAlphabetManualShifted();
         mState.onReleaseShift(NOT_SLIDING);
         assertAlphabetManualShifted();
@@ -244,13 +245,13 @@
         // Double tap recognized in LatinKeyboardView.KeyTimerHandler.
         mState.onToggleCapsLock();
         assertAlphabetShiftLocked();
-        mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE);
+        mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE, NO_AUTO_CAPS);
         assertAlphabetShiftLocked();
 
         // First shift key tap.
         mState.onPressShift(NOT_SLIDING);
         assertAlphabetManualShifted();
-        mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE);
+        mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE, NO_AUTO_CAPS);
         assertAlphabetManualShifted();
         mState.onReleaseShift(NOT_SLIDING);
         assertAlphabetNormal();
