Expose WebView#onCheckIsTextEditor
WebView was never returning correct return value in
onCheckIsTextEditor(). However, startinput optimization work at
ag/3455281, requires a correct return value when switching between
windows. Chrome-side change (crrev.com/c/952217) has dropped into
66.0.3359.14.
BUG: 74199870
Test: manually verified
Change-Id: I954365a70f1ff2680ed9a6d76e695c1193a4cfa3
diff --git a/api/system-current.txt b/api/system-current.txt
index 0555263..4e42661 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6655,6 +6655,7 @@
method public abstract android.os.Handler getHandler(android.os.Handler);
method public abstract void onActivityResult(int, int, android.content.Intent);
method public abstract void onAttachedToWindow();
+ method public default boolean onCheckIsTextEditor();
method public abstract void onConfigurationChanged(android.content.res.Configuration);
method public abstract android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo);
method public abstract void onDetachedFromWindow();
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index fadc3dc..5d3f1c9 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -3121,6 +3121,11 @@
mProvider.getViewDelegate().onActivityResult(requestCode, resultCode, data);
}
+ @Override
+ public boolean onCheckIsTextEditor() {
+ return mProvider.getViewDelegate().onCheckIsTextEditor();
+ }
+
/** @hide */
@Override
protected void encodeProperties(@NonNull ViewHierarchyEncoder encoder) {
diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java
index a896925..a474a85 100644
--- a/core/java/android/webkit/WebViewProvider.java
+++ b/core/java/android/webkit/WebViewProvider.java
@@ -424,6 +424,11 @@
public Handler getHandler(Handler originalHandler);
public View findFocus(View originalFocusedView);
+
+ @SuppressWarnings("unused")
+ default boolean onCheckIsTextEditor() {
+ return false;
+ }
}
interface ScrollDelegate {