summaryrefslogtreecommitdiffstats
path: root/services/core
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2014-04-08 05:48:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-08 05:48:45 +0000
commit59fee2d5534965f0986e68e0c3562da5e65e6c45 (patch)
treeff54ed3210e0c30d6e6a7968c9f39b230fc15073 /services/core
parent1f3f55b434ce324c5fdbe74db1982fea4812a2e9 (diff)
parentb7b7907fb5e4b2252b3c594a6bc4402217fe662a (diff)
downloadframeworks_base-59fee2d5534965f0986e68e0c3562da5e65e6c45.zip
frameworks_base-59fee2d5534965f0986e68e0c3562da5e65e6c45.tar.gz
frameworks_base-59fee2d5534965f0986e68e0c3562da5e65e6c45.tar.bz2
Merge "Allow IMEs to start/stop receiving onUpdateCursor callback"
Diffstat (limited to 'services/core')
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index e69c9a4..6fc3e77 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -148,6 +148,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
static final int MSG_UNBIND_METHOD = 3000;
static final int MSG_BIND_METHOD = 3010;
static final int MSG_SET_ACTIVE = 3020;
+ static final int MSG_SET_CURSOR_ANCHOR_MONITOR_MODE = 3030;
static final int MSG_HARD_KEYBOARD_SWITCH_CHANGED = 4000;
@@ -2275,6 +2276,27 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
}
+ @Override
+ public void setCursorAnchorMonitorMode(IBinder token, int monitorMode) {
+ if (DEBUG) {
+ Slog.d(TAG, "setCursorAnchorMonitorMode: monitorMode=" + monitorMode);
+ }
+ if (!calledFromValidUser()) {
+ return;
+ }
+ synchronized (mMethodMap) {
+ if (token == null || mCurToken != token) {
+ if (DEBUG) {
+ Slog.w(TAG, "Ignoring setCursorAnchorMonitorMode from uid "
+ + Binder.getCallingUid() + " token: " + token);
+ }
+ return;
+ }
+ executeOrSendMessage(mCurMethod, mCaller.obtainMessageIO(
+ MSG_SET_CURSOR_ANCHOR_MONITOR_MODE, monitorMode, mCurClient));
+ }
+ }
+
private void setInputMethodWithSubtypeId(IBinder token, String id, int subtypeId) {
synchronized (mMethodMap) {
if (token == null) {
@@ -2506,6 +2528,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
+ ((ClientState)msg.obj).uid);
}
return true;
+ case MSG_SET_CURSOR_ANCHOR_MONITOR_MODE:
+ try {
+ ((ClientState)msg.obj).client.setCursorAnchorMonitorMode(msg.arg1);
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Got RemoteException sending setCursorAnchorMonitorMode "
+ + "notification to pid " + ((ClientState)msg.obj).pid
+ + " uid " + ((ClientState)msg.obj).uid);
+ }
+ return true;
// --------------------------------------------------------------
case MSG_HARD_KEYBOARD_SWITCH_CHANGED: