Hide ongoing notification icon when the screen is locked.

Bug: 5858903
Change-Id: Ibee9123f4a520e77f4baf8bdd3d75364ab451100
This commit is contained in:
satok
2012-04-02 19:33:47 +09:00
parent fbdff47add
commit 2c93efc9eb

View File

@ -1132,6 +1132,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
private boolean needsToShowImeSwitchOngoingNotification() {
if (!mShowOngoingImeSwitcherForPhones) return false;
if (isScreenLocked()) return false;
synchronized (mMethodMap) {
List<InputMethodInfo> imis = mSettings.getEnabledInputMethodListLocked();
final int N = imis.size();
@ -2148,15 +2149,18 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mContext.startActivity(intent);
}
private boolean isScreenLocked() {
return mKeyguardManager != null
&& mKeyguardManager.isKeyguardLocked() && mKeyguardManager.isKeyguardSecure();
}
private void showInputMethodMenuInternal(boolean showSubtypes) {
if (DEBUG) Slog.v(TAG, "Show switching menu");
final Context context = mContext;
final PackageManager pm = context.getPackageManager();
final boolean isScreenLocked = mKeyguardManager != null
&& mKeyguardManager.isKeyguardLocked() && mKeyguardManager.isKeyguardSecure();
final boolean isScreenLocked = isScreenLocked();
String lastInputMethodId = Settings.Secure.getString(context
final String lastInputMethodId = Settings.Secure.getString(context
.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
int lastInputMethodSubtypeId = getSelectedInputMethodSubtypeId(lastInputMethodId);
if (DEBUG) Slog.v(TAG, "Current IME: " + lastInputMethodId);