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

Commit 6518424d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Unhide NetworkRequest API which use legacy type" am: cd2ffc26 am: d8d358dc

Change-Id: I3a72ed77540329a355547c115b0250d00ccf5630
parents 14dee436 d8d358dc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4300,6 +4300,7 @@ package android.net {
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported();
    method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public int registerNetworkProvider(@NonNull android.net.NetworkProvider);
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEventCallback);
    method @Deprecated public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, int, int, @NonNull android.os.Handler);
    method @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", android.Manifest.permission.NETWORK_SETUP_WIZARD, "android.permission.NETWORK_STACK"}) public void setAirplaneMode(boolean);
    method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, "android.permission.NETWORK_STACK"}) public boolean shouldAvoidBadWifi();
    method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(@NonNull android.net.Network, @NonNull android.os.Bundle);
+15 −3
Original line number Diff line number Diff line
@@ -3622,14 +3622,26 @@ public class ConnectivityManager {
    /**
     * Helper function to request a network with a particular legacy type.
     *
     * This is temporarily public @hide so it can be called by system code that uses the
     * NetworkRequest API to request networks but relies on CONNECTIVITY_ACTION broadcasts for
     * instead network notifications.
     * @deprecated This is temporarily public for tethering to backwards compatibility that uses
     * the NetworkRequest API to request networks with legacy type and relies on
     * CONNECTIVITY_ACTION broadcasts instead of NetworkCallbacks. New caller should use
     * {@link #requestNetwork(NetworkRequest, NetworkCallback, Handler)} instead.
     *
     * TODO: update said system code to rely on NetworkCallbacks and make this method private.

     * @param request {@link NetworkRequest} describing this request.
     * @param networkCallback The {@link NetworkCallback} to be utilized for this request. Note
     *                        the callback must not be shared - it uniquely specifies this request.
     * @param timeoutMs The time in milliseconds to attempt looking for a suitable network
     *                  before {@link NetworkCallback#onUnavailable()} is called. The timeout must
     *                  be a positive value (i.e. >0).
     * @param legacyType to specify the network type(#TYPE_*).
     * @param handler {@link Handler} to specify the thread upon which the callback will be invoked.
     *
     * @hide
     */
    @SystemApi
    @Deprecated
    public void requestNetwork(@NonNull NetworkRequest request,
            @NonNull NetworkCallback networkCallback, int timeoutMs, int legacyType,
            @NonNull Handler handler) {