diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 22ab3e4..13a7273 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -137,8 +137,7 @@
         mKeyboardSet = builder.build();
         final KeyboardId mainKeyboardId = mKeyboardSet.getMainKeyboardId();
         try {
-            mState.onLoadKeyboard(mResources.getString(R.string.layout_switch_back_symbols),
-                    hasDistinctMultitouch());
+            mState.onLoadKeyboard(mResources.getString(R.string.layout_switch_back_symbols));
         } catch (RuntimeException e) {
             Log.w(TAG, "loading keyboard failed: " + mainKeyboardId, e);
             LatinImeLogger.logOnException(mainKeyboardId.toString(), e);
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index c43b985..b3d8f97 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -26,7 +26,7 @@
  *
  * This class contains all keyboard state transition logic.
  *
- * The input events are {@link #onLoadKeyboard(String, boolean)}, {@link #onSaveKeyboardState()},
+ * The input events are {@link #onLoadKeyboard(String)}, {@link #onSaveKeyboardState()},
  * {@link #onPressKey(int)}, {@link #onReleaseKey(int, boolean)},
  * {@link #onCodeInput(int, boolean, boolean)}, {@link #onCancelInput(boolean)},
  * {@link #onUpdateShiftState(boolean)}.
@@ -74,7 +74,6 @@
     private int mSwitchState = SWITCH_STATE_ALPHA;
 
     private String mLayoutSwitchBackSymbols;
-    private boolean mHasDistinctMultitouch;
 
     private final SwitchActions mSwitchActions;
 
@@ -95,12 +94,11 @@
         mSwitchActions = switchActions;
     }
 
-    public void onLoadKeyboard(String layoutSwitchBackSymbols, boolean hasDistinctMultitouch) {
+    public void onLoadKeyboard(String layoutSwitchBackSymbols) {
         if (DEBUG_EVENT) {
             Log.d(TAG, "onLoadKeyboard");
         }
         mLayoutSwitchBackSymbols = layoutSwitchBackSymbols;
-        mHasDistinctMultitouch = hasDistinctMultitouch;
         mKeyboardShiftState.setShifted(false);
         mKeyboardShiftState.setShiftLocked(false);
         mShiftKeyState.onRelease();
@@ -164,18 +162,16 @@
         if (DEBUG_ACTION) {
             Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode));
         }
-        if (shiftMode == SwitchActions.AUTOMATIC_SHIFT) {
+        switch (shiftMode) {
+        case SwitchActions.AUTOMATIC_SHIFT:
             mKeyboardShiftState.setAutomaticTemporaryUpperCase();
-        } else {
-            final boolean shifted = (shiftMode == SwitchActions.MANUAL_SHIFT);
-            // On non-distinct multi touch panel device, we should also turn off the shift locked
-            // state when shift key is pressed to go to normal mode.
-            // On the other hand, on distinct multi touch panel device, turning off the shift
-            // locked state with shift key pressing is handled by onReleaseShift().
-            if (!mHasDistinctMultitouch && !shifted && mKeyboardShiftState.isShiftLocked()) {
-                mSwitchActions.setShiftLocked(false);
-            }
-            mKeyboardShiftState.setShifted(shifted);
+            break;
+        case SwitchActions.MANUAL_SHIFT:
+            mKeyboardShiftState.setShifted(true);
+            break;
+        case SwitchActions.UNSHIFT:
+            mKeyboardShiftState.setShifted(false);
+            break;
         }
         mSwitchActions.setShifted(shiftMode);
     }
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java
similarity index 92%
rename from tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java
rename to tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java
index 05ef103..b00f7f6 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2012 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
@@ -16,12 +16,7 @@
 
 package com.android.inputmethod.keyboard.internal;
 
-public class KeyboardStateTests extends KeyboardStateNonDistinctTests {
-    @Override
-    public boolean hasDistinctMultitouch() {
-        return true;
-    }
-
+public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
     // Shift key chording input.
     public void testShiftChording() {
         // Press shift key and hold, enter into choring shift state.
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateNonDistinctTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java
similarity index 98%
rename from tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateNonDistinctTests.java
rename to tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java
index 3cb9996..04f4f45 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateNonDistinctTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java
@@ -16,12 +16,7 @@
 
 package com.android.inputmethod.keyboard.internal;
 
-public class KeyboardStateNonDistinctTests extends KeyboardStateTestsBase {
-    @Override
-    public boolean hasDistinctMultitouch() {
-        return false;
-    }
-
+public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
     // Shift key in alphabet mode.
     public void testShift() {
         // Press/release shift key, enter into shift state.
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java
index b088b84..6eaa0e9 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java
@@ -22,8 +22,6 @@
         implements MockKeyboardSwitcher.Constants {
     protected MockKeyboardSwitcher mSwitcher;
 
-    public abstract boolean hasDistinctMultitouch();
-
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -45,7 +43,7 @@
     }
 
     public void loadKeyboard(String layoutSwitchBackSymbols, int afterLoad) {
-        mSwitcher.loadKeyboard(layoutSwitchBackSymbols, hasDistinctMultitouch());
+        mSwitcher.loadKeyboard(layoutSwitchBackSymbols);
         updateShiftState(afterLoad);
     }
 
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java
index 147ab57..9692945 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java
@@ -104,9 +104,8 @@
         mState.onUpdateShiftState(mAutoCapsMode && mAutoCapsState);
     }
 
-    public void loadKeyboard(String layoutSwitchBackSymbols,
-            boolean hasDistinctMultitouch) {
-        mState.onLoadKeyboard(layoutSwitchBackSymbols, hasDistinctMultitouch);
+    public void loadKeyboard(String layoutSwitchBackSymbols) {
+        mState.onLoadKeyboard(layoutSwitchBackSymbols);
     }
 
     public void onPressKey(int code) {
