From 19dd34a02320b7a368c4ad65398248ceca41b69e Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 25 Aug 2014 15:56:08 +0900 Subject: [PATCH] Show view even when IME is explicitly shown with physical keyboard Bug: 17242477 Bug: 13988700 Change-Id: I519c0481760a9aa93a5d9bee68e0f6a3a8fc4d9d --- java/src/com/android/inputmethod/latin/LatinIME.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 466ac8c69..8bf1688df 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; @@ -1137,6 +1138,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return true; } + @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()) {