Add the Assist support to Webview
Bug: 19771298
Implement the Webview API to provide assist data. Webview assist
data is provided asynchronously.
Change-Id: I2fbf3e5ce7779ba6664dfbc6a702880fe71d5126
diff --git a/api/system-current.txt b/api/system-current.txt
index 3f2e19b..78b23ad 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -40862,6 +40862,7 @@
method public abstract boolean onKeyUp(int, android.view.KeyEvent);
method public abstract void onMeasure(int, int);
method public abstract void onOverScrolled(int, int, boolean, boolean);
+ method public abstract void onProvideVirtualAssistStructure(android.view.ViewAssistStructure);
method public abstract void onScrollChanged(int, int, int, int);
method public abstract void onSizeChanged(int, int, int, int);
method public abstract void onStartTemporaryDetach();
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index aa77d5e..7ab5aaa 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -40,6 +40,7 @@
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewAssistStructure;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
@@ -2424,6 +2425,11 @@
return WebView.class.getName();
}
+ @Override
+ public void onProvideVirtualAssistStructure(ViewAssistStructure structure) {
+ mProvider.getViewDelegate().onProvideVirtualAssistStructure(structure);
+ }
+
/** @hide */
@Override
public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java
index fa2ce1b..d5787de 100644
--- a/core/java/android/webkit/WebViewProvider.java
+++ b/core/java/android/webkit/WebViewProvider.java
@@ -32,6 +32,7 @@
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewAssistStructure;
import android.view.ViewGroup.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -298,6 +299,8 @@
interface ViewDelegate {
public boolean shouldDelayChildPressedState();
+ public void onProvideVirtualAssistStructure(ViewAssistStructure structure);
+
public AccessibilityNodeProvider getAccessibilityNodeProvider();
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info);