Methods Summary |
---|
public void | addWebViewAssetPath(android.content.Context context)Adds the WebView asset path to {@link AssetManager}.
context.getAssets().addAssetPath(
WebViewFactory.getLoadedPackageInfo().applicationInfo.sourceDir);
|
public void | callDrawGlFunction(android.graphics.Canvas canvas, long nativeDrawGLFunctor)Calls the function specified with the nativeDrawGLFunctor functor pointer. This
functionality is used by the WebView for calling into their renderer from the
framework display lists.
if (!(canvas instanceof HardwareCanvas)) {
// Canvas#isHardwareAccelerated() is only true for subclasses of HardwareCanvas.
throw new IllegalArgumentException(canvas.getClass().getName()
+ " is not hardware accelerated");
}
((HardwareCanvas) canvas).callDrawGLFunction2(nativeDrawGLFunctor);
|
public boolean | canInvokeDrawGlFunctor(android.view.View containerView)Returns true if the draw GL functor can be invoked (see {@link #invokeDrawGlFunctor})
and false otherwise.
ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
// viewRootImpl can be null during teardown when window is leaked.
return viewRootImpl != null;
|
public void | detachDrawGlFunctor(android.view.View containerView, long nativeDrawGLFunctor)Detaches the draw GL functor.
ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
if (nativeDrawGLFunctor != 0 && viewRootImpl != null) {
viewRootImpl.detachFunctor(nativeDrawGLFunctor);
}
|
public android.app.Application | getApplication()Returns the application which is embedding the WebView.
return ActivityThread.currentApplication();
|
public java.lang.String | getErrorString(android.content.Context context, int errorCode)Returns the error string for the given {@code errorCode}.
return ErrorStrings.getString(errorCode, context);
|
public int | getPackageId(android.content.res.Resources resources, java.lang.String packageName)Returns the package id of the given {@code packageName}.
SparseArray<String> packageIdentifiers =
resources.getAssets().getAssignedPackageIdentifiers();
for (int i = 0; i < packageIdentifiers.size(); i++) {
final String name = packageIdentifiers.valueAt(i);
if (packageName.equals(name)) {
return packageIdentifiers.keyAt(i);
}
}
throw new RuntimeException("Package not found: " + packageName);
|
public void | invokeDrawGlFunctor(android.view.View containerView, long nativeDrawGLFunctor, boolean waitForCompletion)Invokes the draw GL functor. If waitForCompletion is false the functor
may be invoked asynchronously.
ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
viewRootImpl.invokeFunctor(nativeDrawGLFunctor, waitForCompletion);
|
public boolean | isTraceTagEnabled()Returns true if the WebView trace tag is enabled and false otherwise.
return Trace.isTagEnabled(Trace.TRACE_TAG_WEBVIEW);
|
public void | setOnTraceEnabledChangeListener(android.webkit.WebViewDelegate$OnTraceEnabledChangeListener listener)Register a callback to be invoked when tracing for the WebView component has been
enabled/disabled.
SystemProperties.addChangeCallback(new Runnable() {
@Override
public void run() {
listener.onTraceEnabledChange(isTraceTagEnabled());
}
});
|