diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 5660d19..320b1be 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -388,6 +388,7 @@
         }
     }
 
+    // TODO: Move this method to KeyboardSwitcher.
     public static String toThemeName(int themeId) {
         // This should be aligned with theme-*.xml resource files' themeId attribute.
         switch (themeId) {
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index ac8dd1b..efe5aa9 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -39,8 +39,7 @@
 import com.android.inputmethod.latin.SubtypeSwitcher;
 import com.android.inputmethod.latin.Utils;
 
-public class KeyboardSwitcher implements KeyboardState.SwitchActions,
-        SharedPreferences.OnSharedPreferenceChangeListener {
+public class KeyboardSwitcher implements KeyboardState.SwitchActions {
     private static final String TAG = KeyboardSwitcher.class.getSimpleName();
 
     public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20110916";
@@ -94,7 +93,6 @@
         mSubtypeSwitcher = SubtypeSwitcher.getInstance();
         mState = new KeyboardState(this);
         setContextThemeWrapper(ims, getKeyboardThemeIndex(ims, prefs));
-        prefs.registerOnSharedPreferenceChangeListener(this);
         mForceNonDistinctMultitouch = prefs.getBoolean(
                 DebugSettings.FORCE_NON_DISTINCT_MULTITOUCH_KEY, false);
     }
@@ -341,34 +339,26 @@
     }
 
     public View onCreateInputView() {
-        return createInputView(mThemeIndex, true);
-    }
-
-    private View createInputView(final int newThemeIndex, final boolean forceRecreate) {
-        if (mCurrentInputView != null && mThemeIndex == newThemeIndex && !forceRecreate)
-            return mCurrentInputView;
-
         if (mKeyboardView != null) {
             mKeyboardView.closing();
         }
 
-        final int oldThemeIndex = mThemeIndex;
         Utils.GCUtils.getInstance().reset();
         boolean tryGC = true;
         for (int i = 0; i < Utils.GCUtils.GC_TRY_LOOP_MAX && tryGC; ++i) {
             try {
-                setContextThemeWrapper(mInputMethodService, newThemeIndex);
+                setContextThemeWrapper(mInputMethodService, mThemeIndex);
                 mCurrentInputView = (InputView)LayoutInflater.from(mThemeContext).inflate(
                         R.layout.input_view, null);
                 tryGC = false;
             } catch (OutOfMemoryError e) {
                 Log.w(TAG, "load keyboard failed: " + e);
                 tryGC = Utils.GCUtils.getInstance().tryGCOrWait(
-                        oldThemeIndex + "," + newThemeIndex, e);
+                        Keyboard.toThemeName(mThemeIndex), e);
             } catch (InflateException e) {
                 Log.w(TAG, "load keyboard failed: " + e);
                 tryGC = Utils.GCUtils.getInstance().tryGCOrWait(
-                        oldThemeIndex + "," + newThemeIndex, e);
+                        Keyboard.toThemeName(mThemeIndex), e);
             }
         }
 
@@ -385,27 +375,6 @@
         return mCurrentInputView;
     }
 
-    private void postSetInputView(final View newInputView) {
-        final LatinIME latinIme = mInputMethodService;
-        latinIme.mHandler.post(new Runnable() {
-            @Override
-            public void run() {
-                if (newInputView != null) {
-                    latinIme.setInputView(newInputView);
-                }
-                latinIme.updateInputViewShown();
-            }
-        });
-    }
-
-    @Override
-    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
-        if (PREF_KEYBOARD_LAYOUT.equals(key)) {
-            final int themeIndex = getKeyboardThemeIndex(mInputMethodService, sharedPreferences);
-            postSetInputView(createInputView(themeIndex, false));
-        }
-    }
-
     public void onNetworkStateChanged() {
         if (mKeyboardView != null) {
             mKeyboardView.updateShortcutKey(SubtypeSwitcher.getInstance().isShortcutImeReady());
diff --git a/java/src/com/android/inputmethod/latin/DebugSettings.java b/java/src/com/android/inputmethod/latin/DebugSettings.java
index 3805da1..870b33f 100644
--- a/java/src/com/android/inputmethod/latin/DebugSettings.java
+++ b/java/src/com/android/inputmethod/latin/DebugSettings.java
@@ -25,6 +25,8 @@
 import android.preference.PreferenceActivity;
 import android.util.Log;
 
+import com.android.inputmethod.keyboard.KeyboardSwitcher;
+
 public class DebugSettings extends PreferenceActivity
         implements SharedPreferences.OnSharedPreferenceChangeListener {
 
@@ -61,7 +63,8 @@
                 updateDebugMode();
                 mServiceNeedsRestart = true;
             }
-        } else if (key.equals(FORCE_NON_DISTINCT_MULTITOUCH_KEY)) {
+        } else if (key.equals(FORCE_NON_DISTINCT_MULTITOUCH_KEY)
+                || key.equals(KeyboardSwitcher.PREF_KEYBOARD_LAYOUT)) {
             mServiceNeedsRestart = true;
         }
     }
