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

Commit 67d3dfd9 authored by Pavel Maltsev's avatar Pavel Maltsev
Browse files

Add hasUnwantedCapability method

If you put values into the Builder, you should be able to observe
those values on the built object.

Test: atest android.net.cts.NetworkRequestTest

Bug: 74945408
Bug: 72828388
Change-Id: Ib4026b8d7370d570f1b606f0d221d00fed6e787d
parent 78e80568
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27256,6 +27256,7 @@ package android.net {
    method public int describeContents();
    method public boolean hasCapability(int);
    method public boolean hasTransport(int);
    method public boolean hasUnwantedCapability(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.NetworkRequest> CREATOR;
  }
+9 −0
Original line number Diff line number Diff line
@@ -172,6 +172,8 @@ public class NetworkRequest implements Parcelable {
         * If the given capability was previously added to the list of unwanted capabilities
         * then the capability will also be removed from the list of unwanted capabilities.
         *
         * @see #addUnwantedCapability(int)
         *
         * @param capability The capability to add.
         * @return The builder to facilitate chaining
         *         {@code builder.addCapability(...).addCapability();}.
@@ -435,6 +437,13 @@ public class NetworkRequest implements Parcelable {
        return networkCapabilities.hasCapability(capability);
    }

    /**
     * @see Builder#addUnwantedCapability(int)
     */
    public boolean hasUnwantedCapability(@NetCapability int capability) {
        return networkCapabilities.hasUnwantedCapability(capability);
    }

    /**
     * @see Builder#addTransportType(int)
     */