diff options
author | Satoshi Kataoka <satok@google.com> | 2012-11-26 19:39:18 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-11-26 19:39:20 -0800 |
commit | 1af084113713743c70df04702083fff5a5325482 (patch) | |
tree | 1ef3aeee73c2fbb06f4697112ceda9c3de12152b /services/java/com/android/server/InputMethodManagerService.java | |
parent | de0bf8bc2c9814e255b45abf0453260fff5ebffa (diff) | |
parent | 8d03305b576e429909e420c235163c2be1aae732 (diff) | |
download | frameworks_base-1af084113713743c70df04702083fff5a5325482.zip frameworks_base-1af084113713743c70df04702083fff5a5325482.tar.gz frameworks_base-1af084113713743c70df04702083fff5a5325482.tar.bz2 |
Merge "Hide current soft input when a background user gains window focus." into jb-mr1.1-dev
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 c33fc71..8eb532d 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); |