FileDocCategorySizeDatePackage
PermissionRequest.javaAPI DocAndroid 5.1 API2986Thu Mar 12 22:22:10 GMT 2015android.webkit

PermissionRequest

public abstract class PermissionRequest extends Object
This class defines a permission request and is used when web content requests access to protected resources. The permission request related events are delivered via {@link WebChromeClient#onPermissionRequest} and {@link WebChromeClient#onPermissionRequestCanceled}. Either {@link #grant(String[]) grant()} or {@link #deny()} must be called in UI thread to respond to the request.

Fields Summary
public static final String
RESOURCE_VIDEO_CAPTURE
Resource belongs to video capture device, like camera.
public static final String
RESOURCE_AUDIO_CAPTURE
Resource belongs to audio capture device, like microphone.
public static final String
RESOURCE_PROTECTED_MEDIA_ID
Resource belongs to protected media identifier. After the user grants this resource, the origin can use EME APIs to generate the license requests.
Constructors Summary
Methods Summary
public abstract voiddeny()
Call this method to deny the request.

public abstract android.net.UrigetOrigin()
Call this method to get the origin of the web page which is trying to access the restricted resources.

return
the origin of web content which attempt to access the restricted resources.

public abstract java.lang.String[]getResources()
Call this method to get the resources the web page is trying to access.

return
the array of resources the web content wants to access.

public abstract voidgrant(java.lang.String[] resources)
Call this method to grant origin the permission to access the given resources. The granted permission is only valid for this WebView.

param
resources the resources granted to be accessed by origin, to grant request, the requested resources returned by {@link #getResources()} must be equals or a subset of granted resources. This parameter is designed to avoid granting permission by accident especially when new resources are requested by web content.