diff options
| author | Satoshi Kataoka <satok@google.com> | 2012-11-27 17:34:02 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-27 17:34:02 -0800 |
| commit | 48d3111ef186d988ca6d096c72cef63c2c2eac42 (patch) | |
| tree | b84bc740f01b1afe402122d9645a845da669e99c /services/java/com/android/server/InputMethodManagerService.java | |
| parent | e44a51ba10f8c6038a053ba45433d4f5b9d74926 (diff) | |
| parent | c86ae7cf318f6c9d8cf581447e8897fbc1245ef3 (diff) | |
am c86ae7cf: am 1c37b800: am 1af08411: Merge "Hide current soft input when a background user gains window focus." into jb-mr1.1-dev
* commit 'c86ae7cf318f6c9d8cf581447e8897fbc1245ef3':
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.java | 14 |
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 85bc259bbd9e..3b6052665e72 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); |
