diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 140e76879..77cdf49fb 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -261,6 +261,9 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } public void onToggleEmojiKeyboard() { + if (mKeyboardLayoutSet == null) { + return; + } if (isShowingEmojiPalettes()) { setAlphabetKeyboard(); } else { diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index f9df57cf8..6045b3428 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -51,6 +51,7 @@ import android.view.WindowManager; import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.CursorAnchorInfo; import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethod; import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.accessibility.AccessibilityUtils; @@ -1139,6 +1140,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } @Override + public boolean onShowInputRequested(final int flags, final boolean configChange) { + if ((flags & InputMethod.SHOW_EXPLICIT) == 0 && mKeyboardSwitcher.hasHardwareKeyboard()) { + // Even when IME is implicitly shown and physical keyboard is connected, we should + // show {@link InputView}. + // See {@link InputMethodService#onShowInputRequested(int,boolean)}. + return true; + } + return super.onShowInputRequested(flags, configChange); + } + + @Override public boolean onEvaluateFullscreenMode() { if (mKeyboardSwitcher.hasHardwareKeyboard()) { // If there is a hardware keyboard, disable full screen mode. |