aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2014-09-03 01:05:39 -0700
committerYohei Yukawa <yukawa@google.com>2014-09-03 01:13:15 -0700
commit5d6ac77732b6fe29489deecc297d771642150a2b (patch)
treef8eade4eb77b859fe6f1d64c2676829746bd4c25
parent8c42bf54af9afe44eade9f0c36cfd2136d20e2f6 (diff)
downloadlatinime-5d6ac77732b6fe29489deecc297d771642150a2b.tar.gz
latinime-5d6ac77732b6fe29489deecc297d771642150a2b.tar.xz
latinime-5d6ac77732b6fe29489deecc297d771642150a2b.zip
Follow up API signature change
This is a follow up CL for API signature change in I772c48ff18918e48a81e807b48ff907614485c09 BUG: 17320996 Change-Id: Ic8b6162bda12bf74fae79af212c5d81c400eb9e8
-rw-r--r--java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java32
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java6
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java2
3 files changed, 19 insertions, 21 deletions
diff --git a/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java b/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java
index 862ec8a58..a5c71b22f 100644
--- a/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java
+++ b/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java
@@ -21,30 +21,29 @@ import android.view.inputmethod.InputMethodManager;
public final class InputConnectionCompatUtils {
private static final CompatUtils.ClassWrapper sInputConnectionType;
- private static final CompatUtils.ToBooleanMethodWrapper sRequestUpdateCursorAnchorInfoMethod;
+ private static final CompatUtils.ToBooleanMethodWrapper sRequestCursorUpdatesMethod;
static {
sInputConnectionType = new CompatUtils.ClassWrapper(InputConnection.class);
- sRequestUpdateCursorAnchorInfoMethod = sInputConnectionType.getPrimitiveMethod(
- "requestUpdateCursorAnchorInfo", false, int.class);
+ sRequestCursorUpdatesMethod = sInputConnectionType.getPrimitiveMethod(
+ "requestCursorUpdates", false, int.class);
}
- public static boolean isRequestUpdateCursorAnchorInfoAvailable() {
- return sRequestUpdateCursorAnchorInfoMethod != null;
+ public static boolean isRequestCursorUpdatesAvailable() {
+ return sRequestCursorUpdatesMethod != null;
}
/**
- * Local copies of some constants in CursorAnchorInfoRequest until the SDK becomes publicly
- * available.
+ * Local copies of some constants in InputConnection until the SDK becomes publicly available.
*/
- private static int REQUEST_UPDATE_CURSOR_UPDATE_IMMEDIATE = 1 << 0;
- private static int REQUEST_UPDATE_CURSOR_UPDATE_MONITOR = 1 << 1;
+ private static int CURSOR_UPDATE_IMMEDIATE = 1 << 0;
+ private static int CURSOR_UPDATE_MONITOR = 1 << 1;
- private static boolean requestUpdateCursorAnchorInfoImpl(final InputConnection inputConnection,
+ private static boolean requestCursorUpdatesImpl(final InputConnection inputConnection,
final int cursorUpdateMode) {
- if (!isRequestUpdateCursorAnchorInfoAvailable()) {
+ if (!isRequestCursorUpdatesAvailable()) {
return false;
}
- return sRequestUpdateCursorAnchorInfoMethod.invoke(inputConnection, cursorUpdateMode);
+ return sRequestCursorUpdatesMethod.invoke(inputConnection, cursorUpdateMode);
}
/**
@@ -56,11 +55,10 @@ public final class InputConnectionCompatUtils {
* as soon as possible to notify the current cursor/anchor position to the input method.
* @return {@code false} if the request is not handled. Otherwise returns {@code true}.
*/
- public static boolean requestUpdateCursorAnchorInfo(final InputConnection inputConnection,
+ public static boolean requestCursorUpdates(final InputConnection inputConnection,
final boolean enableMonitor, final boolean requestImmediateCallback) {
- final int cursorUpdateMode = (enableMonitor ? REQUEST_UPDATE_CURSOR_UPDATE_MONITOR : 0)
- | (requestImmediateCallback ? REQUEST_UPDATE_CURSOR_UPDATE_IMMEDIATE : 0);
- return requestUpdateCursorAnchorInfoImpl(inputConnection, cursorUpdateMode);
+ final int cursorUpdateMode = (enableMonitor ? CURSOR_UPDATE_MONITOR : 0)
+ | (requestImmediateCallback ? CURSOR_UPDATE_IMMEDIATE : 0);
+ return requestCursorUpdatesImpl(inputConnection, cursorUpdateMode);
}
-
}
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index f1c7f4340..6b6384c48 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -922,13 +922,13 @@ public final class RichInputConnection {
* prevents the application from fulfilling the request. (TODO: Improve the API when it turns
* out that we actually need more detailed error codes)
*/
- public boolean requestUpdateCursorAnchorInfo(final boolean enableMonitor,
+ public boolean requestCursorUpdates(final boolean enableMonitor,
final boolean requestImmediateCallback) {
mIC = mParent.getCurrentInputConnection();
final boolean scheduled;
if (null != mIC) {
- scheduled = InputConnectionCompatUtils.requestUpdateCursorAnchorInfo(mIC,
- enableMonitor, requestImmediateCallback);
+ scheduled = InputConnectionCompatUtils.requestCursorUpdates(mIC, enableMonitor,
+ requestImmediateCallback);
} else {
scheduled = false;
}
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index e35fed9c8..89aea4310 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -167,7 +167,7 @@ public final class InputLogic {
if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) {
// AcceptTypedWord feature relies on CursorAnchorInfo.
if (settingsValues.mShouldShowUiToAcceptTypedWord) {
- mConnection.requestUpdateCursorAnchorInfo(true /* enableMonitor */,
+ mConnection.requestCursorUpdates(true /* enableMonitor */,
true /* requestImmediateCallback */);
}
}