Fix the documentation for onReceivedError.
This change adds the EventHandler error codes to WebViewClient for the public api. Previously, the api was ambiguous about the value of the errorCode parameter and falsely documented that the values are HTTP status codes.
This commit is contained in:
165
api/current.xml
165
api/current.xml
@ -167386,6 +167386,171 @@
|
|||||||
<parameter name="url" type="java.lang.String">
|
<parameter name="url" type="java.lang.String">
|
||||||
</parameter>
|
</parameter>
|
||||||
</method>
|
</method>
|
||||||
|
<field name="ERROR_AUTHENTICATION"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-4"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_BAD_URL"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-12"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_CONNECT"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-6"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_FAILED_SSL_HANDSHAKE"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-11"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_FILE"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-13"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_FILE_NOT_FOUND"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-14"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_HOST_LOOKUP"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-2"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_IO"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-7"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_PROXY_AUTHENTICATION"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-5"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_REDIRECT_LOOP"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-9"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_TIMEOUT"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-8"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_TOO_MANY_REQUESTS"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-15"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_UNKNOWN"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-1"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_UNSUPPORTED_AUTH_SCHEME"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-3"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="ERROR_UNSUPPORTED_SCHEME"
|
||||||
|
type="int"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value="-10"
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
</class>
|
</class>
|
||||||
<class name="WebViewDatabase"
|
<class name="WebViewDatabase"
|
||||||
extends="java.lang.Object"
|
extends="java.lang.Object"
|
||||||
|
@ -92,14 +92,46 @@ public class WebViewClient {
|
|||||||
cancelMsg.sendToTarget();
|
cancelMsg.sendToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These ints must match up to the hidden values in EventHandler.
|
||||||
|
/** Generic error */
|
||||||
|
public static final int ERROR_UNKNOWN = -1;
|
||||||
|
/** Server or proxy hostname lookup failed */
|
||||||
|
public static final int ERROR_HOST_LOOKUP = -2;
|
||||||
|
/** Unsupported authentication scheme (not basic or digest) */
|
||||||
|
public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3;
|
||||||
|
/** User authentication failed on server */
|
||||||
|
public static final int ERROR_AUTHENTICATION = -4;
|
||||||
|
/** User authentication failed on proxy */
|
||||||
|
public static final int ERROR_PROXY_AUTHENTICATION = -5;
|
||||||
|
/** Failed to connect to the server */
|
||||||
|
public static final int ERROR_CONNECT = -6;
|
||||||
|
/** Failed to read or write to the server */
|
||||||
|
public static final int ERROR_IO = -7;
|
||||||
|
/** Connection timed out */
|
||||||
|
public static final int ERROR_TIMEOUT = -8;
|
||||||
|
/** Too many redirects */
|
||||||
|
public static final int ERROR_REDIRECT_LOOP = -9;
|
||||||
|
/** Unsupported URI scheme */
|
||||||
|
public static final int ERROR_UNSUPPORTED_SCHEME = -10;
|
||||||
|
/** Failed to perform SSL handshake */
|
||||||
|
public static final int ERROR_FAILED_SSL_HANDSHAKE = -11;
|
||||||
|
/** Malformed URL */
|
||||||
|
public static final int ERROR_BAD_URL = -12;
|
||||||
|
/** Generic file error */
|
||||||
|
public static final int ERROR_FILE = -13;
|
||||||
|
/** File not found */
|
||||||
|
public static final int ERROR_FILE_NOT_FOUND = -14;
|
||||||
|
/** Too many requests during this load */
|
||||||
|
public static final int ERROR_TOO_MANY_REQUESTS = -15;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report an error to an activity. These errors come up from WebCore, and
|
* Report an error to the host application. These errors are unrecoverable
|
||||||
* are network errors.
|
* (i.e. the main resource is unavailable). The errorCode parameter
|
||||||
*
|
* corresponds to one of the ERROR_* constants.
|
||||||
* @param view The WebView that is initiating the callback.
|
* @param view The WebView that is initiating the callback.
|
||||||
* @param errorCode The HTTP error code.
|
* @param code The error code corresponding to an ERROR_* value.
|
||||||
* @param description A String description.
|
* @param description A String describing the error.
|
||||||
* @param failingUrl The url that failed.
|
* @param failingUrl The url that failed to load.
|
||||||
*/
|
*/
|
||||||
public void onReceivedError(WebView view, int errorCode,
|
public void onReceivedError(WebView view, int errorCode,
|
||||||
String description, String failingUrl) {
|
String description, String failingUrl) {
|
||||||
|
Reference in New Issue
Block a user