SafeBrowsingResponse


public abstract class SafeBrowsingResponse
extends Object

java.lang.Object
   ↳ android.webkit.SafeBrowsingResponse


Used to indicate an action to take when hitting a malicious URL. Instances of this class are created by the WebView and passed to WebViewClient.onSafeBrowsingHit(WebView, WebResourceRequest, int, SafeBrowsingResponse). The host application must call showInterstitial(boolean), proceed(boolean), or backToSafety(boolean) to set the WebView's response to the Safe Browsing hit.

If reporting is enabled, all reports will be sent according to the privacy policy referenced by WebView.getSafeBrowsingPrivacyPolicyUrl().

Summary

Public constructors

SafeBrowsingResponse()

This constructor is deprecated. This class should not be constructed by applications.

Public methods

abstract void backToSafety(boolean report)

Act as if the user clicked the "back to safety" button.

abstract void proceed(boolean report)

Act as if the user clicked the "visit this unsafe site" button.

abstract void showInterstitial(boolean allowReporting)

Display the default interstitial.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

SafeBrowsingResponse

Added in API level 27
public SafeBrowsingResponse ()

This constructor is deprecated.
This class should not be constructed by applications.

Public methods

backToSafety

Added in API level 27
public abstract void backToSafety (boolean report)

Act as if the user clicked the "back to safety" button.

Parameters
report boolean: true to enable Safe Browsing reporting.

proceed

Added in API level 27
public abstract void proceed (boolean report)

Act as if the user clicked the "visit this unsafe site" button.

Parameters
report boolean: true to enable Safe Browsing reporting.

showInterstitial

Added in API level 27
public abstract void showInterstitial (boolean allowReporting)

Display the default interstitial.

Parameters
allowReporting boolean: true if the interstitial should show a reporting checkbox.