Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9688)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java

Issue 1278593004: Introduce ThreadedInputConnection behind a switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed ImeTest#testDoesNotHang_rendererCrashes which does not test anything Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java b/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
index 6a26dbc9c6c65082496000c280bbe6bbbf5e5713..673a3740925a1196b1510e37e49277531ec95aec 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
@@ -15,6 +15,9 @@ import android.view.inputmethod.InputMethodManager;
import org.chromium.base.Log;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
/**
* Wrapper around Android's InputMethodManager
*/
@@ -88,4 +91,23 @@ public class InputMethodManagerWrapper {
getInputMethodManager().updateCursorAnchorInfo(view, cursorAnchorInfo);
}
}
+
+ /**
+ * Notify that a user took some action with the current input method. Without this call
+ * an input method app may wait longer when the user switches methods within the app.
+ */
+ public void notifyUserAction() {
+ // On N and above, this is not needed.
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) return;
+ Log.d(TAG, "notifyUserAction");
+ InputMethodManager manager = getInputMethodManager();
+ try {
+ Method method = InputMethodManager.class.getMethod("notifyUserAction");
+ method.invoke(manager);
+ } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException
palmer 2016/02/25 23:49:55 These are all subclasses of RuntimeException, righ
Changwan Ryu 2016/02/26 02:41:19 Hmm... I think it is a matter of readability and d
+ | InvocationTargetException e) {
+ Log.d(TAG, "notifyUserAction failed");
+ return;
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698