Loading services/core/java/com/android/server/InputMethodManagerService.java +49 −44 Original line number Original line 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 (!mShowOngoingImeSwitcherForPhones) return false; if (mSwitchingDialog != null) return false; if (mSwitchingDialog != null) return false; if (isScreenLocked()) 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(); List<InputMethodInfo> imis = mSettings.getEnabledInputMethodListLocked(); final int N = imis.size(); final int N = imis.size(); if (N > 2) return true; if (N > 2) return true; Loading Loading @@ -1671,7 +1680,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } return false; return false; } } } private boolean isKeyguardLocked() { private boolean isKeyguardLocked() { return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked(); return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked(); Loading @@ -1697,11 +1705,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mImeWindowVis = vis; mImeWindowVis = vis; mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0); mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0); mBackDisposition = backDisposition; mBackDisposition = backDisposition; final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0) // mImeWindowVis should be updated before calling shouldShowImeSwitcherLocked(). && (mWindowManagerService.isHardKeyboardAvailable() final boolean needsToShowImeSwitcher = shouldShowImeSwitcherLocked(); || (vis & (InputMethodService.IME_VISIBLE)) != 0); final boolean needsToShowImeSwitcher = iconVisibility && needsToShowImeSwitchOngoingNotification(); if (mStatusBar != null) { if (mStatusBar != null) { mStatusBar.setImeWindowStatus(token, vis, backDisposition, mStatusBar.setImeWindowStatus(token, vis, backDisposition, needsToShowImeSwitcher); needsToShowImeSwitcher); Loading Loading
services/core/java/com/android/server/InputMethodManagerService.java +49 −44 Original line number Original line 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 (!mShowOngoingImeSwitcherForPhones) return false; if (mSwitchingDialog != null) return false; if (mSwitchingDialog != null) return false; if (isScreenLocked()) 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(); List<InputMethodInfo> imis = mSettings.getEnabledInputMethodListLocked(); final int N = imis.size(); final int N = imis.size(); if (N > 2) return true; if (N > 2) return true; Loading Loading @@ -1671,7 +1680,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } return false; return false; } } } private boolean isKeyguardLocked() { private boolean isKeyguardLocked() { return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked(); return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked(); Loading @@ -1697,11 +1705,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mImeWindowVis = vis; mImeWindowVis = vis; mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0); mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0); mBackDisposition = backDisposition; mBackDisposition = backDisposition; final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0) // mImeWindowVis should be updated before calling shouldShowImeSwitcherLocked(). && (mWindowManagerService.isHardKeyboardAvailable() final boolean needsToShowImeSwitcher = shouldShowImeSwitcherLocked(); || (vis & (InputMethodService.IME_VISIBLE)) != 0); final boolean needsToShowImeSwitcher = iconVisibility && needsToShowImeSwitchOngoingNotification(); if (mStatusBar != null) { if (mStatusBar != null) { mStatusBar.setImeWindowStatus(token, vis, backDisposition, mStatusBar.setImeWindowStatus(token, vis, backDisposition, needsToShowImeSwitcher); needsToShowImeSwitcher); Loading