Loading services/core/java/com/android/server/InputMethodManagerService.java +49 −44 Original line number Diff line number Diff line Loading @@ -1624,11 +1624,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } private boolean needsToShowImeSwitchOngoingNotification() { private boolean shouldShowImeSwitcherLocked() { if (!mShowOngoingImeSwitcherForPhones) return false; if (mSwitchingDialog != null) return false; if (isScreenLocked()) return false; synchronized (mMethodMap) { if ((mImeWindowVis & InputMethodService.IME_ACTIVE) == 0) return false; if (mWindowManagerService.isHardKeyboardAvailable()) { // When physical keyboard is attached, we show the ime switcher (or notification if // NavBar is not available) because SHOW_IME_WITH_HARD_KEYBOARD settings currently // exists in the IME switcher dialog. Might be OK to remove this condition once // SHOW_IME_WITH_HARD_KEYBOARD settings finds a good place to live. return true; } if ((mImeWindowVis & InputMethodService.IME_VISIBLE) == 0) return false; List<InputMethodInfo> imis = mSettings.getEnabledInputMethodListLocked(); final int N = imis.size(); if (N > 2) return true; Loading Loading @@ -1671,7 +1680,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } return false; } } private boolean isKeyguardLocked() { return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked(); Loading @@ -1697,11 +1705,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mImeWindowVis = vis; mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0); mBackDisposition = backDisposition; final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0) && (mWindowManagerService.isHardKeyboardAvailable() || (vis & (InputMethodService.IME_VISIBLE)) != 0); final boolean needsToShowImeSwitcher = iconVisibility && needsToShowImeSwitchOngoingNotification(); // mImeWindowVis should be updated before calling shouldShowImeSwitcherLocked(). final boolean needsToShowImeSwitcher = shouldShowImeSwitcherLocked(); if (mStatusBar != null) { mStatusBar.setImeWindowStatus(token, vis, backDisposition, needsToShowImeSwitcher); Loading Loading
services/core/java/com/android/server/InputMethodManagerService.java +49 −44 Original line number Diff line number Diff line Loading @@ -1624,11 +1624,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } private boolean needsToShowImeSwitchOngoingNotification() { private boolean shouldShowImeSwitcherLocked() { if (!mShowOngoingImeSwitcherForPhones) return false; if (mSwitchingDialog != null) return false; if (isScreenLocked()) return false; synchronized (mMethodMap) { if ((mImeWindowVis & InputMethodService.IME_ACTIVE) == 0) return false; if (mWindowManagerService.isHardKeyboardAvailable()) { // When physical keyboard is attached, we show the ime switcher (or notification if // NavBar is not available) because SHOW_IME_WITH_HARD_KEYBOARD settings currently // exists in the IME switcher dialog. Might be OK to remove this condition once // SHOW_IME_WITH_HARD_KEYBOARD settings finds a good place to live. return true; } if ((mImeWindowVis & InputMethodService.IME_VISIBLE) == 0) return false; List<InputMethodInfo> imis = mSettings.getEnabledInputMethodListLocked(); final int N = imis.size(); if (N > 2) return true; Loading Loading @@ -1671,7 +1680,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } return false; } } private boolean isKeyguardLocked() { return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked(); Loading @@ -1697,11 +1705,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mImeWindowVis = vis; mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0); mBackDisposition = backDisposition; final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0) && (mWindowManagerService.isHardKeyboardAvailable() || (vis & (InputMethodService.IME_VISIBLE)) != 0); final boolean needsToShowImeSwitcher = iconVisibility && needsToShowImeSwitchOngoingNotification(); // mImeWindowVis should be updated before calling shouldShowImeSwitcherLocked(). final boolean needsToShowImeSwitcher = shouldShowImeSwitcherLocked(); if (mStatusBar != null) { mStatusBar.setImeWindowStatus(token, vis, backDisposition, needsToShowImeSwitcher); Loading