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

Commit b8ca68cb authored by Richard Coles's avatar Richard Coles
Browse files

WebViewUpdateManager API feedback.

Define an "other" failure code for WebViewProviderResponse for future
compatibility, and update doc comments to clarify/correct issues.

Bug: 325635567, 319292658
Test: m checkapi
Change-Id: I96f8fee3a6cd4e08ea294a6e4b00a71077cba1fd
parent cd18a51a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -652,6 +652,7 @@ package android.webkit {
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.webkit.WebViewProviderResponse> CREATOR;
    field public static final int STATUS_FAILED_LISTING_WEBVIEW_PACKAGES = 4; // 0x4
    field public static final int STATUS_FAILED_OTHER = 11; // 0xb
    field public static final int STATUS_FAILED_WAITING_FOR_RELRO = 3; // 0x3
    field public static final int STATUS_SUCCESS = 0; // 0x0
    field @Nullable public final android.content.pm.PackageInfo packageInfo;
+3 −0
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ public final class WebViewFactory {
    // error for namespace lookup
    public static final int LIBLOAD_FAILED_TO_FIND_NAMESPACE = 10;

    // generic error for future use
    static final int LIBLOAD_FAILED_OTHER = 11;

    /**
     * Stores the timestamps at which various WebView startup events occurred in this process.
     */
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ public final class WebViewProviderResponse implements Parcelable {
                STATUS_SUCCESS,
                STATUS_FAILED_WAITING_FOR_RELRO,
                STATUS_FAILED_LISTING_WEBVIEW_PACKAGES,
                STATUS_FAILED_OTHER,
            })
    @Retention(RetentionPolicy.SOURCE)
    private @interface WebViewProviderStatus {}
@@ -49,6 +50,7 @@ public final class WebViewProviderResponse implements Parcelable {
            WebViewFactory.LIBLOAD_FAILED_WAITING_FOR_RELRO;
    public static final int STATUS_FAILED_LISTING_WEBVIEW_PACKAGES =
            WebViewFactory.LIBLOAD_FAILED_LISTING_WEBVIEW_PACKAGES;
    public static final int STATUS_FAILED_OTHER = WebViewFactory.LIBLOAD_FAILED_OTHER;

    public WebViewProviderResponse(
            @Nullable PackageInfo packageInfo, @WebViewProviderStatus int status) {
+2 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ public final class WebViewUpdateManager {
     *
     * This choice will be stored persistently.
     *
     * @param newProvider the package name to use, or null to reset to default.
     * @param newProvider the package name to use.
     * @return the package name which is now in use, which may not be the
     *         requested one if it was not usable.
     */
@@ -155,7 +155,7 @@ public final class WebViewUpdateManager {
    /**
     * Get the WebView provider which will be used if no explicit choice has been made.
     *
     * The default provider is not guaranteed to be currently valid/usable.
     * The default provider is not guaranteed to be a valid/usable WebView implementation.
     *
     * @return the default WebView provider.
     */