Skip to content

Commit bc7b6fc

Browse files
author
John Spurlock
committed
Fix IME down caret in keyguard nav bar bug.
The input method manager service now keeps track of whether or not the ime was shown on the keyguard. This prevents activities behind the keyguard from incorrectly showing the down-caret in the keyguard. Bug:7498792 Change-Id: I0de01ec29cb544e902305b0f9d9fb94a73835e7b
1 parent a711d1e commit bc7b6fc

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ public String toString() {
386386
private Locale mLastSystemLocale;
387387
private final MyPackageMonitor mMyPackageMonitor = new MyPackageMonitor();
388388
private final IPackageManager mIPackageManager;
389+
private boolean mInputBoundToKeyguard;
389390

390391
class SettingsObserver extends ContentObserver {
391392
SettingsObserver(Handler handler) {
@@ -877,10 +878,12 @@ private void refreshImeWindowVisibilityLocked() {
877878
final boolean hardKeyShown = haveHardKeyboard
878879
&& conf.hardKeyboardHidden
879880
!= Configuration.HARDKEYBOARDHIDDEN_YES;
880-
final boolean isScreenLocked = mKeyguardManager != null
881-
&& mKeyguardManager.isKeyguardLocked()
882-
&& mKeyguardManager.isKeyguardSecure();
883-
mImeWindowVis = (!isScreenLocked && (mInputShown || hardKeyShown)) ?
881+
final boolean isScreenLocked =
882+
mKeyguardManager != null && mKeyguardManager.isKeyguardLocked();
883+
final boolean isScreenSecurelyLocked =
884+
isScreenLocked && mKeyguardManager.isKeyguardSecure();
885+
final boolean inputShown = mInputShown && (!isScreenLocked || mInputBoundToKeyguard);
886+
mImeWindowVis = (!isScreenSecurelyLocked && (inputShown || hardKeyShown)) ?
884887
(InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE) : 0;
885888
updateImeWindowStatusLocked();
886889
}
@@ -1124,6 +1127,13 @@ InputBindResult startInputUncheckedLocked(ClientState cs,
11241127
return mNoBinding;
11251128
}
11261129

1130+
if (mCurClient == null) {
1131+
mInputBoundToKeyguard = mKeyguardManager != null && mKeyguardManager.isKeyguardLocked();
1132+
if (DEBUG) {
1133+
Slog.v(TAG, "New bind. keyguard = " + mInputBoundToKeyguard);
1134+
}
1135+
}
1136+
11271137
if (mCurClient != cs) {
11281138
// If the client is changing, we need to switch over to the new
11291139
// one.

0 commit comments

Comments
 (0)