diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 1f70ecc..a3f03f8 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -48,7 +48,6 @@
         SharedPreferences.OnSharedPreferenceChangeListener {
     private static final String TAG = KeyboardSwitcher.class.getSimpleName();
     private static final boolean DEBUG_CACHE = LatinImeLogger.sDBG;
-    public static final boolean DEBUG_STATE = false;
 
     public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20110916";
     private static final int[] KEYBOARD_THEMES = {
@@ -355,9 +354,6 @@
      * Toggle keyboard shift state triggered by user touch event.
      */
     public void toggleShift() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "toggleShift: " + mState);
-        }
         mState.onToggleShift(isAlphabetMode(), isSymbolShifted());
     }
 
@@ -365,9 +361,6 @@
      * Toggle caps lock state triggered by user touch event.
      */
     public void toggleCapsLock() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "toggleCapsLock: " + mState);
-        }
         mState.onToggleCapsLock(isAlphabetMode());
     }
 
@@ -375,9 +368,6 @@
      * Toggle between alphabet and symbols modes triggered by user touch event.
      */
     public void toggleAlphabetAndSymbols() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "toggleAlphabetAndSymbols: " + mState);
-        }
         mState.onToggleAlphabetAndSymbols(isAlphabetMode());
     }
 
@@ -385,49 +375,26 @@
      * Update keyboard shift state triggered by connected EditText status change.
      */
     public void updateShiftState() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "updateShiftState: " + mState
-                    + " autoCaps=" + mInputMethodService.getCurrentAutoCapsState());
-        }
         mState.onUpdateShiftState(isAlphabetMode(), mInputMethodService.getCurrentAutoCapsState());
     }
 
     public void onPressShift(boolean withSliding) {
-        if (!isKeyboardAvailable())
-            return;
-        if (DEBUG_STATE) {
-            Log.d(TAG, "onPressShift: " + mState + " sliding=" + withSliding);
-        }
-        mState.onPressShift(isAlphabetMode(), isSymbolShifted());
+        mState.onPressShift(isAlphabetMode(), isSymbolShifted(), withSliding);
     }
 
     public void onReleaseShift(boolean withSliding) {
-        if (!isKeyboardAvailable())
-            return;
-        if (DEBUG_STATE) {
-            Log.d(TAG, "onReleaseShift: " + mState + " sliding=" + withSliding);
-        }
         mState.onReleaseShift(isAlphabetMode(), isSymbolShifted(), withSliding);
     }
 
     public void onPressSymbol() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "onPressSymbol: " + mState);
-        }
         mState.onPressSymbol(isAlphabetMode());
     }
 
     public void onReleaseSymbol() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "onReleaseSymbol: " + mState);
-        }
         mState.onReleaseSymbol(isAlphabetMode());
     }
 
     public void onOtherKeyPressed() {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "onOtherKeyPressed: " + mState);
-        }
         mState.onOtherKeyPressed();
     }
 
@@ -478,10 +445,6 @@
      * Updates state machine to figure out when to automatically snap back to the previous mode.
      */
     public void onCodeInput(int code) {
-        if (DEBUG_STATE) {
-            Log.d(TAG, "onCodeInput: code=" + code + " isSinglePointer=" + isSinglePointer()
-                    + " " + mState);
-        }
         mState.onCodeInput(isAlphabetMode(), isSymbolShifted(), code, isSinglePointer());
     }
 
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java
index 4a77e07..11fb91a 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java
@@ -18,11 +18,9 @@
 
 import android.util.Log;
 
-import com.android.inputmethod.keyboard.KeyboardSwitcher;
-
 public class KeyboardShiftState {
     private static final String TAG = KeyboardShiftState.class.getSimpleName();
-    private static final boolean DEBUG = KeyboardSwitcher.DEBUG_STATE;
+    private static final boolean DEBUG = false;
 
     private static final int NORMAL = 0;
     private static final int MANUAL_SHIFTED = 1;
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 8cf0539..f7ec08d 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -78,6 +78,9 @@
     }
 
     public void onLoadKeyboard(String layoutSwitchBackSymbols, boolean hasDistinctMultitouch) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onLoadKeyboard");
+        }
         mLayoutSwitchBackSymbols = layoutSwitchBackSymbols;
         mHasDistinctMultitouch = hasDistinctMultitouch;
         mKeyboardShiftState.setShifted(false);
@@ -101,7 +104,7 @@
         }
         state.mIsValid = true;
         if (DEBUG_STATE) {
-            Log.d(TAG, "save: alphabet=" + state.mIsAlphabetMode
+            Log.d(TAG, "onSaveKeyboardState: alphabet=" + state.mIsAlphabetMode
                     + " shiftLocked=" + state.mIsShiftLocked + " shift=" + state.mIsShifted);
         }
     }
@@ -109,7 +112,8 @@
     private void onRestoreKeyboardState() {
         final SavedKeyboardState state = mSavedKeyboardState;
         if (DEBUG_STATE) {
-            Log.d(TAG, "restore: valid=" + state.mIsValid + " alphabet=" + state.mIsAlphabetMode
+            Log.d(TAG, "onRestoreKeyboardState: valid=" + state.mIsValid
+                    + " alphabet=" + state.mIsAlphabetMode
                     + " shiftLocked=" + state.mIsShiftLocked + " shift=" + state.mIsShifted);
         }
         if (!state.mIsValid || state.mIsAlphabetMode) {
@@ -158,6 +162,9 @@
     }
 
     private void setShifted(int shiftMode) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode));
+        }
         if (shiftMode == SwitchActions.AUTOMATIC_SHIFT) {
             mKeyboardShiftState.setAutomaticTemporaryUpperCase();
         } else {
@@ -176,6 +183,9 @@
     }
 
     private void setShiftLocked(boolean shiftLocked) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "setShiftLocked: shiftLocked=" + shiftLocked);
+        }
         mKeyboardShiftState.setShiftLocked(shiftLocked);
         mSwitchActions.setShiftLocked(shiftLocked);
     }
@@ -197,6 +207,9 @@
     }
 
     private void setAlphabetKeyboard() {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "setAlphabetKeyboard");
+        }
         mSwitchActions.setAlphabetKeyboard();
         mSwitchState = SWITCH_STATE_ALPHA;
         setShiftLocked(mPrevMainKeyboardWasShiftLocked);
@@ -204,18 +217,27 @@
     }
 
     private void setSymbolsKeyboard() {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "setSymbolsKeyboard");
+        }
         mPrevMainKeyboardWasShiftLocked = isShiftLocked();
         mSwitchActions.setSymbolsKeyboard();
         mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
     }
 
     private void setSymbolsShiftedKeyboard() {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "setSymbolsShiftedKeyboard");
+        }
         mSwitchActions.setSymbolsShiftedKeyboard();
         mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
     }
 
     // TODO: Get rid of isAlphabetMode argument.
     public void onPressSymbol(boolean isAlphabetMode) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onPressSymbol: " + this);
+        }
         toggleAlphabetAndSymbols(isAlphabetMode);
         mSymbolKeyState.onPress();
         mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL;
@@ -223,6 +245,9 @@
 
     // TODO: Get rid of isAlphabetMode argument.
     public void onReleaseSymbol(boolean isAlphabetMode) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onReleaseSymbol: " + this);
+        }
         // Snap back to the previous keyboard mode if the user chords the mode change key and
         // another key, then releases the mode change key.
         if (mSwitchState == SWITCH_STATE_CHORDING_ALPHA) {
@@ -232,12 +257,18 @@
     }
 
     public void onOtherKeyPressed() {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onOtherKeyPressed: " + this);
+        }
         mShiftKeyState.onOtherKeyPressed();
         mSymbolKeyState.onOtherKeyPressed();
     }
 
     // TODO: Get rid of isAlphabetMode argument.
     public void onUpdateShiftState(boolean isAlphabetMode, boolean autoCaps) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onUpdateShiftState: " + this + " autoCaps=" + autoCaps);
+        }
         if (isAlphabetMode) {
             if (!isShiftLocked() && !mShiftKeyState.isIgnoring()) {
                 if (mShiftKeyState.isReleasing() && autoCaps) {
@@ -256,7 +287,10 @@
     }
 
     // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onPressShift(boolean isAlphabetMode, boolean isSymbolShifted) {
+    public void onPressShift(boolean isAlphabetMode, boolean isSymbolShifted, boolean withSliding) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onPressShift: " + this + " sliding=" + withSliding);
+        }
         if (isAlphabetMode) {
             if (isShiftLocked()) {
                 // Shift key is pressed while caps lock state, we will treat this state as shifted
@@ -288,6 +322,9 @@
     // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
     public void onReleaseShift(boolean isAlphabetMode, boolean isSymbolShifted,
             boolean withSliding) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onReleaseShift: " + this + " sliding=" + withSliding);
+        }
         if (isAlphabetMode) {
             final boolean isShiftLocked = isShiftLocked();
             if (mShiftKeyState.isMomentary()) {
@@ -322,6 +359,9 @@
     // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
     public void onCancelInput(boolean isAlphabetMode, boolean isSymbolShifted,
             boolean isSinglePointer) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onCancelInput: isSinglePointer=" + isSinglePointer + " " + this);
+        }
         // Snap back to the previous keyboard mode if the user cancels sliding input.
         if (isSinglePointer) {
             if (mSwitchState == SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL) {
@@ -350,6 +390,10 @@
     // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
     public void onCodeInput(boolean isAlphabetMode, boolean isSymbolShifted, int code,
             boolean isSinglePointer) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onCodeInput: code=" + code + " isSinglePointer=" + isSinglePointer
+                    + " " + this);
+        }
         switch (mSwitchState) {
         case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL:
             // Only distinct multi touch devices can be in this state.
@@ -414,6 +458,9 @@
 
     // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
     public void onToggleShift(boolean isAlphabetMode, boolean isSymbolShifted) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onToggleShift: " + this);
+        }
         if (isAlphabetMode) {
             setShifted(isShiftedOrShiftLocked()
                     ? SwitchActions.UNSHIFT : SwitchActions.MANUAL_SHIFT);
@@ -424,6 +471,9 @@
 
     // TODO: Get rid of isAlphabetMode arguments.
     public void onToggleCapsLock(boolean isAlphabetMode) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onToggleCapsLock: " + this);
+        }
         if (isAlphabetMode) {
             if (isShiftLocked()) {
                 setShiftLocked(false);
@@ -438,9 +488,20 @@
 
     // TODO: Get rid of isAlphabetMode arguments.
     public void onToggleAlphabetAndSymbols(boolean isAlphabetMode) {
+        if (DEBUG_STATE) {
+            Log.d(TAG, "onToggleAlphabetAndSymbols: " + this);
+        }
         toggleAlphabetAndSymbols(isAlphabetMode);
     }
 
+    private static String shiftModeToString(int shiftMode) {
+        switch (shiftMode) {
+        case SwitchActions.UNSHIFT: return "UNSHIFT";
+        case SwitchActions.MANUAL_SHIFT: return "MANUAL";
+        case SwitchActions.AUTOMATIC_SHIFT: return "AUTOMATIC";
+        default: return null;
+        }
+    }
     private static String switchStateToString(int switchState) {
         switch (switchState) {
         case SWITCH_STATE_ALPHA: return "ALPHA";
diff --git a/java/src/com/android/inputmethod/keyboard/internal/ModifierKeyState.java b/java/src/com/android/inputmethod/keyboard/internal/ModifierKeyState.java
index f862091..f95c916 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/ModifierKeyState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/ModifierKeyState.java
@@ -18,11 +18,9 @@
 
 import android.util.Log;
 
-import com.android.inputmethod.keyboard.KeyboardSwitcher;
-
 /* package */ class ModifierKeyState {
     protected static final String TAG = "ModifierKeyState";
-    protected static final boolean DEBUG = KeyboardSwitcher.DEBUG_STATE;
+    protected static final boolean DEBUG = false;
 
     protected static final int RELEASING = 0;
     protected static final int PRESSING = 1;
