AW: relax WebResourceResponse requirements

This swaps onReceivedHttpError() to use the WebResourceResponse
@SystemApi constructor in all code paths. The public constructor
enforces several requirements which are either too strict (ex.
reasonPhrase cannot be empty, however it was removed from the HTTP/2
spec) or are undesirable to enforce for callbacks (some web servers use
invalid status code; we would prefer for the app to handle this rather
than crash WebView).

Since we dropped Android L support, we can use this constructor in both
code paths.

Bug: b/235960500
Test: None - this constructor is more relaxed than before and has been
Test: in use for the non-AndroidX code path for many years.
Change-Id: I6801d0e1a97f3b03e055353f90a7d15799bb9267
Commit-Queue: Nate Fischer <>
Auto-Submit: Nate Fischer <>
Reviewed-by: Richard Coles <>
Cr-Commit-Position: refs/heads/main@{#1016858}
GitOrigin-RevId: 509be3a549fe30c31e31d81b54a2493fe0be1de2
1 file changed
tree: eb7799c4a63c43a10f4336bb52511600b968439c
  1. java/


This folder contains a shim layer between the public frameworks APIs (android.webkit.*) and WebView's implementation, and allows them to (mostly) not directly depend on each other.

Folder Dependencies

//android_webview/java/ must not depend on this directory.

See Also