@@ -1132,6 +1132,7 @@ public void updateStatusIcon(IBinder token, String packageName, int iconId) {
11321132
11331133 private boolean needsToShowImeSwitchOngoingNotification () {
11341134 if (!mShowOngoingImeSwitcherForPhones ) return false ;
1135+ if (isScreenLocked ()) return false ;
11351136 synchronized (mMethodMap ) {
11361137 List <InputMethodInfo > imis = mSettings .getEnabledInputMethodListLocked ();
11371138 final int N = imis .size ();
@@ -2148,15 +2149,18 @@ private void showConfigureInputMethods() {
21482149 mContext .startActivity (intent );
21492150 }
21502151
2152+ private boolean isScreenLocked () {
2153+ return mKeyguardManager != null
2154+ && mKeyguardManager .isKeyguardLocked () && mKeyguardManager .isKeyguardSecure ();
2155+ }
21512156 private void showInputMethodMenuInternal (boolean showSubtypes ) {
21522157 if (DEBUG ) Slog .v (TAG , "Show switching menu" );
21532158
21542159 final Context context = mContext ;
21552160 final PackageManager pm = context .getPackageManager ();
2156- final boolean isScreenLocked = mKeyguardManager != null
2157- && mKeyguardManager .isKeyguardLocked () && mKeyguardManager .isKeyguardSecure ();
2161+ final boolean isScreenLocked = isScreenLocked ();
21582162
2159- String lastInputMethodId = Settings .Secure .getString (context
2163+ final String lastInputMethodId = Settings .Secure .getString (context
21602164 .getContentResolver (), Settings .Secure .DEFAULT_INPUT_METHOD );
21612165 int lastInputMethodSubtypeId = getSelectedInputMethodSubtypeId (lastInputMethodId );
21622166 if (DEBUG ) Slog .v (TAG , "Current IME: " + lastInputMethodId );
0 commit comments