private void setKeyboardMode(int mode, int imeOptions, boolean isSymbols) {
    if (mInputView == null) return;
    mMode = mode;
    mImeOptions = imeOptions;
    mIsSymbols = isSymbols;

    mInputView.setTextSizeScale(mInputMethodService.getKeyTextSizeScale());
    mInputView.setPreviewEnabled(mInputMethodService.getPopupOn());
    KeyboardId id = getKeyboardId(mode, imeOptions, isSymbols);
    SoftKeyboard keyboard = null;
    keyboard = getKeyboard(id);

    mCurrentId = id;
    mInputView.setKeyboard(keyboard);
    keyboard.setShifted(false);
    keyboard.setShiftLocked(keyboard.isShiftLocked());
    keyboard.setImeOptions(mInputMethodService.getResources(), mMode, imeOptions);
    keyboard.setColorOfSymbolIcons(
        mIsAutoCompletionActive,
        mInputView.getLanguagebarTextColor(),
        mInputView.getLanguagebarShadowColor());
    // Update the settings key state because number of enabled IMEs could have been changed
    updateSettingsKeyState(PreferenceManager.getDefaultSharedPreferences(mInputMethodService));
    updateLanguageKeyState(PreferenceManager.getDefaultSharedPreferences(mInputMethodService));
  }