Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c7c9370 authored by Nate Fischer's avatar Nate Fischer
Browse files

Add WebView Safe Browsing error code

This adds a Safe Browsing specific network error code for WebView. This
will be returned when we cancel page load because the end user has
clicked "Back to safety" on an interstitial page, the WebView is too
small to display a readable interstitial page, or other similar cases.

When this is used due to an unsafe subresource, the error passed to
WebViewClient#OnReceivedError() will be associated with that specific
resource, not the main frame.

Bug: 36007752
Test: N/A
Change-Id: I8b149a9d6e4ed113de0dd8ee051a2934af477128
parent 9f2888d9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48522,6 +48522,7 @@ package android.webkit {
    field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
    field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
    field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
    field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
    field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
    field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
  }
+1 −0
Original line number Diff line number Diff line
@@ -52080,6 +52080,7 @@ package android.webkit {
    field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
    field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
    field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
    field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
    field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
    field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
  }
+1 −0
Original line number Diff line number Diff line
@@ -48887,6 +48887,7 @@ package android.webkit {
    field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
    field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
    field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
    field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
    field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
    field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
  }
+2 −0
Original line number Diff line number Diff line
@@ -234,6 +234,8 @@ public class WebViewClient {
    public static final int ERROR_FILE_NOT_FOUND = -14;
    /** Too many requests during this load */
    public static final int ERROR_TOO_MANY_REQUESTS = -15;
    /** Resource load was cancelled by Safe Browsing */
    public static final int ERROR_UNSAFE_RESOURCE = -16;

    /**
     * Report an error to the host application. These errors are unrecoverable