summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/InputMethodManagerService.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-11-27 11:36:25 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-11-27 11:36:25 -0800
commitc86ae7cf318f6c9d8cf581447e8897fbc1245ef3 (patch)
tree28dfbe3bea87f9c85e516015da79a4c719ea78a9 /services/java/com/android/server/InputMethodManagerService.java
parent30913478b083de92e75755adef3b8a32a3cb2fd5 (diff)
parent1c37b8000999c98e8cb5fe76c1f52d204f901783 (diff)
am 1c37b800: am 1af08411: Merge "Hide current soft input when a background user gains window focus." into jb-mr1.1-dev
* commit '1c37b8000999c98e8cb5fe76c1f52d204f901783': Hide current soft input when a background user gains window focus.
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index c33fc71ed4db..8eb532d2de1f 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1824,9 +1824,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
public InputBindResult windowGainedFocus(IInputMethodClient client, IBinder windowToken,
int controlFlags, int softInputMode, int windowFlags,
EditorInfo attribute, IInputContext inputContext) {
- if (!calledFromValidUser()) {
- return null;
- }
+ // Needs to check the validity before clearing calling identity
+ final boolean calledFromValidUser = calledFromValidUser();
+
InputBindResult res = null;
long ident = Binder.clearCallingIdentity();
try {
@@ -1856,6 +1856,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
} catch (RemoteException e) {
}
+ if (!calledFromValidUser) {
+ Slog.w(TAG, "A background user is requesting window. Hiding IME.");
+ Slog.w(TAG, "If you want to interect with IME, you need "
+ + "android.permission.INTERACT_ACROSS_USERS_FULL");
+ hideCurrentInputLocked(0, null);
+ return null;
+ }
+
if (mCurFocusedWindow == windowToken) {
Slog.w(TAG, "Window already focused, ignoring focus gain of: " + client
+ " attribute=" + attribute + ", token = " + windowToken);