Skip to content

Commit 2c93efc

Browse files
committed
Hide ongoing notification icon when the screen is locked.
Bug: 5858903 Change-Id: Ibee9123f4a520e77f4baf8bdd3d75364ab451100
1 parent fbdff47 commit 2c93efc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

services/java/com/android/server/InputMethodManagerService.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)