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

Commit b7af420f authored by Chiachang Wang's avatar Chiachang Wang
Browse files

Expose NetworkSpecifier methods as SystemApi

Support for Wi-Fi mainline module.

Bug: 135998869
Test: build and make system-api-stubs-docs-update-current-api
Test: atest FrameworksNetTests
Change-Id: Id705ee0f2b5c464f6d8ccc91f20dcb39dcf6f2b8
parent 77f281d5
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -4813,6 +4813,7 @@ package android.net {
  public final class MatchAllNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    ctor public MatchAllNetworkSpecifier();
    method public int describeContents();
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.MatchAllNetworkSpecifier> CREATOR;
  }
@@ -4876,6 +4877,12 @@ package android.net {
    method public void updateScores(@NonNull java.util.List<android.net.ScoredNetwork>);
  }
  public abstract class NetworkSpecifier {
    method public void assertValidFromUid(int);
    method @Nullable public android.net.NetworkSpecifier redact();
    method public abstract boolean satisfiedBy(@Nullable android.net.NetworkSpecifier);
  }
  public class NetworkStack {
    field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK";
  }
@@ -4946,6 +4953,7 @@ package android.net {
  public final class StringNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    ctor public StringNetworkSpecifier(@NonNull String);
    method public int describeContents();
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.StringNetworkSpecifier> CREATOR;
    field @NonNull public final String specifier;
@@ -6058,6 +6066,10 @@ package android.net.wifi {
    field public int numUsage;
  }
  public final class WifiNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
  }
  public static final class WifiNetworkSuggestion.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierId(int);
  }
@@ -6244,6 +6256,10 @@ package android.net.wifi.aware {
    method @Deprecated public android.net.NetworkSpecifier createNetworkSpecifierPmk(@NonNull android.net.wifi.aware.PeerHandle, @NonNull byte[]);
  }
  public final class WifiAwareNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
  }
  public class WifiAwareSession implements java.lang.AutoCloseable {
    method public android.net.NetworkSpecifier createNetworkSpecifierPmk(int, @NonNull byte[], @NonNull byte[]);
  }
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package android.net;

import android.annotation.Nullable;
import android.annotation.SystemApi;

/**
 * Describes specific properties of a requested network for use in a {@link NetworkRequest}.
 *
@@ -31,7 +34,8 @@ public abstract class NetworkSpecifier {
     *
     * @hide
     */
    public abstract boolean satisfiedBy(NetworkSpecifier other);
    @SystemApi
    public abstract boolean satisfiedBy(@Nullable NetworkSpecifier other);

    /**
     * Optional method which can be overridden by concrete implementations of NetworkSpecifier to
@@ -45,6 +49,7 @@ public abstract class NetworkSpecifier {
     *
     * @hide
     */
    @SystemApi
    public void assertValidFromUid(int requestorUid) {
        // empty
    }
@@ -68,6 +73,8 @@ public abstract class NetworkSpecifier {
     *
     * @hide
     */
    @SystemApi
    @Nullable
    public NetworkSpecifier redact() {
        // TODO (b/122160111): convert default to null once all platform NetworkSpecifiers
        // implement this method.