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

Commit e281e579 authored by Junyu Lai's avatar Junyu Lai Committed by Android (Google) Code Review
Browse files

Merge "Expose netId by adding getter API" into rvc-dev

parents 97773cbe 587ecb3a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6258,8 +6258,8 @@ package android.net {
  public class Network implements android.os.Parcelable {
    ctor public Network(@NonNull android.net.Network);
    method public int getNetId();
    method @NonNull public android.net.Network getPrivateDnsBypassingCopy();
    field public final int netId;
  }
  public abstract class NetworkAgent {
+1 −0
Original line number Diff line number Diff line
@@ -1820,6 +1820,7 @@ package android.net {

  public class Network implements android.os.Parcelable {
    ctor public Network(@NonNull android.net.Network);
    method public int getNetId();
    method @NonNull public android.net.Network getPrivateDnsBypassingCopy();
  }

+12 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ public class Network implements Parcelable {
     * The unique id of the network.
     * @hide
     */
    @SystemApi
    @UnsupportedAppUsage
    public final int netId;

    // Objects used to perform per-network operations such as getSocketFactory
@@ -169,6 +169,17 @@ public class Network implements Parcelable {
        return new Network(netId, true);
    }

    /**
     * Get the unique id of the network.
     *
     * @hide
     */
    @TestApi
    @SystemApi
    public int getNetId() {
        return netId;
    }

    /**
     * Returns a netid marked with the Private DNS bypass flag.
     *
+1 −1
Original line number Diff line number Diff line
@@ -1494,7 +1494,7 @@ public class Tethering {
            } else {
                dnsServers = mConfig.defaultIPv4DNS;
            }
            final int netId = (network != null) ? network.netId : NETID_UNSET;
            final int netId = (network != null) ? network.getNetId() : NETID_UNSET;
            try {
                mNetd.tetherDnsSet(netId, dnsServers);
                mLog.log(String.format(