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

Commit f1a408f2 authored by Anna Malova's avatar Anna Malova Committed by Android (Google) Code Review
Browse files

Merge "Add new methods to PacProcessor to"

parents d40ac08a 1d0dede7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -12732,6 +12732,9 @@ package android.webkit {
  public interface PacProcessor {
    method @Nullable public String findProxyForUrl(@NonNull String);
    method @NonNull public static android.webkit.PacProcessor getInstance();
    method @NonNull public static android.webkit.PacProcessor getInstanceForNetwork(long);
    method public default long getNetworkHandle();
    method public default void releasePacProcessor();
    method public boolean setProxyScript(@NonNull String);
  }
@@ -12871,6 +12874,7 @@ package android.webkit {
    method public android.webkit.CookieManager getCookieManager();
    method public android.webkit.GeolocationPermissions getGeolocationPermissions();
    method @NonNull public default android.webkit.PacProcessor getPacProcessor();
    method @NonNull public default android.webkit.PacProcessor getPacProcessorForNetwork(long);
    method public android.webkit.ServiceWorkerController getServiceWorkerController();
    method public android.webkit.WebViewFactoryProvider.Statics getStatics();
    method @Deprecated public android.webkit.TokenBindingService getTokenBindingService();
+34 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package android.webkit;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;

import android.net.Network;

/**
 * Class to evaluate PAC scripts.
@@ -39,6 +39,20 @@ public interface PacProcessor {
        return WebViewFactory.getProvider().getPacProcessor();
    }

    /**
     * Returns PacProcessor instance associated with the {@link Network}.
     * The host resolution is done on this {@link Network}.
     *
     * @param networkHandle a handle representing {@link Network} handle.
     * @return PacProcessor instance for the specified network.
     * @see Network#getNetworkHandle
     * @see Network#fromNetworkHandle
     */
    @NonNull
    static PacProcessor getInstanceForNetwork(long networkHandle) {
        return WebViewFactory.getProvider().getPacProcessorForNetwork(networkHandle);
    }

    /**
     * Set PAC script to use.
     *
@@ -55,4 +69,23 @@ public interface PacProcessor {
     */
    @Nullable
    String findProxyForUrl(@NonNull String url);

    /**
     * Stops support for this {@link PacProcessor} and release its resources.
     * No methods of this class must be called after calling this method.
     */
    default void releasePacProcessor() {
        throw new UnsupportedOperationException("Not implemented");
    }

    /**
     * Returns a network handle associated with this {@link PacProcessor}.
     *
     * @return a network handle or 0 if a network is unspecified.
     * @see Network#getNetworkHandle
     * @see Network#fromNetworkHandle
     */
    default long getNetworkHandle() {
        throw new UnsupportedOperationException("Not implemented");
    }
}
+16 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.content.Context;
import android.content.Intent;
import android.net.Network;
import android.net.Uri;

import java.util.List;
@@ -175,7 +176,7 @@ public interface WebViewFactoryProvider {
    WebViewDatabase getWebViewDatabase(Context context);

    /**
     * Gets the singleton PacProcessor instance.
     * Gets the default PacProcessor instance.
     * @return the PacProcessor instance
     */
    @NonNull
@@ -183,6 +184,20 @@ public interface WebViewFactoryProvider {
        throw new UnsupportedOperationException("Not implemented");
    }

    /**
     * Returns PacProcessor instance associated with the {@link Network}.
     * The host resolution is done on this {@link Network}.
     *
     * @param networkHandle a network handle representing the {@link Network}.
     * @return the {@link PacProcessor} instance associated with {@link Network}.
     * @see Network#getNetworkHandle
     * @see Network#fromNetworkHandle
     */
    @NonNull
    default PacProcessor getPacProcessorForNetwork(long networkHandle) {
        throw new UnsupportedOperationException("Not implemented");
    }

    /**
     * Gets the classloader used to load internal WebView implementation classes. This interface
     * should only be used by the WebView Support Library.
+4 −0
Original line number Diff line number Diff line
@@ -11575,6 +11575,9 @@ package android.webkit {
  public interface PacProcessor {
    method @Nullable public String findProxyForUrl(@NonNull String);
    method @NonNull public static android.webkit.PacProcessor getInstance();
    method @NonNull public static android.webkit.PacProcessor getInstanceForNetwork(long);
    method public default long getNetworkHandle();
    method public default void releasePacProcessor();
    method public boolean setProxyScript(@NonNull String);
  }
@@ -11714,6 +11717,7 @@ package android.webkit {
    method public android.webkit.CookieManager getCookieManager();
    method public android.webkit.GeolocationPermissions getGeolocationPermissions();
    method @NonNull public default android.webkit.PacProcessor getPacProcessor();
    method @NonNull public default android.webkit.PacProcessor getPacProcessorForNetwork(long);
    method public android.webkit.ServiceWorkerController getServiceWorkerController();
    method public android.webkit.WebViewFactoryProvider.Statics getStatics();
    method @Deprecated public android.webkit.TokenBindingService getTokenBindingService();