summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-11-17 18:02:09 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-17 18:02:09 -0800
commit1a3c051bcc787363d9154da4a8e8e562dda32926 (patch)
tree7f6c860abf5bb094ddf82cdfbe216445fd541b7d
parent398f80eacb8e59d868f287bf273a1253fe219ce4 (diff)
parent3afd6c0d4d5c2c80cf0450941babaee32ec9c7ee (diff)
downloadframeworks_base-1a3c051bcc787363d9154da4a8e8e562dda32926.zip
frameworks_base-1a3c051bcc787363d9154da4a8e8e562dda32926.tar.gz
frameworks_base-1a3c051bcc787363d9154da4a8e8e562dda32926.tar.bz2
Merge "Hide/show ime switch icon properly" into ics-mr1
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index ddac35c..f5c4ed4 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -382,6 +382,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
mScreenOn = true;
+ refreshImeWindowVisibilityLocked();
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
mScreenOn = false;
setImeWindowVisibilityStatusHiddenLocked();
@@ -640,6 +641,21 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
updateImeWindowStatusLocked();
}
+ private void refreshImeWindowVisibilityLocked() {
+ final Configuration conf = mRes.getConfiguration();
+ final boolean haveHardKeyboard = conf.keyboard
+ != Configuration.KEYBOARD_NOKEYS;
+ final boolean hardKeyShown = haveHardKeyboard
+ && conf.hardKeyboardHidden
+ != Configuration.HARDKEYBOARDHIDDEN_YES;
+ final boolean isScreenLocked = mKeyguardManager != null
+ && mKeyguardManager.isKeyguardLocked()
+ && mKeyguardManager.isKeyguardSecure();
+ mImeWindowVis = (!isScreenLocked && (mInputShown || hardKeyShown)) ?
+ (InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE) : 0;
+ updateImeWindowStatusLocked();
+ }
+
private void updateImeWindowStatusLocked() {
setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition);
}
@@ -1285,16 +1301,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
if (mCurMethod != null) {
try {
- final Configuration conf = mRes.getConfiguration();
- final boolean haveHardKeyboard = conf.keyboard
- != Configuration.KEYBOARD_NOKEYS;
- final boolean hardKeyShown = haveHardKeyboard
- && conf.hardKeyboardHidden
- != Configuration.HARDKEYBOARDHIDDEN_YES;
- mImeWindowVis = (mInputShown || hardKeyShown) ? (
- InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE)
- : 0;
- updateImeWindowStatusLocked();
+ refreshImeWindowVisibilityLocked();
// If subtype is null, try to find the most applicable one from
// getCurrentInputMethodSubtype.
if (subtype == null) {