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

Commit 7412d7aa authored by Chalard Jean's avatar Chalard Jean
Browse files

Make getNetworkSpecifier() public API.

The builder lets clients set it, and this may be useful for
unit tests of apps. It should be public.
The need arises from uses of this in WiFi and Telephony
network factories.

Test: build
Bug: 135998869
Change-Id: I57279cac139c28e8654d2066ba0c60edd1e6cd98
parent b24e34c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28903,6 +28903,7 @@ package android.net {
  public class NetworkRequest implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.net.NetworkSpecifier getNetworkSpecifier();
    method public boolean hasCapability(int);
    method public boolean hasTransport(int);
    method public void writeToParcel(android.os.Parcel, int);
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.net;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
@@ -461,6 +462,14 @@ public class NetworkRequest implements Parcelable {
        return networkCapabilities.hasTransport(transportType);
    }

    /**
     * @see Builder#setNetworkSpecifier(NetworkSpecifier)
     */
    @Nullable
    public NetworkSpecifier getNetworkSpecifier() {
        return networkCapabilities.getNetworkSpecifier();
    }

    public String toString() {
        return "NetworkRequest [ " + type + " id=" + requestId +
                (legacyType != ConnectivityManager.TYPE_NONE ? ", legacyType=" + legacyType : "") +