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

Commit 55fbcaf9 authored by Lucas Lin's avatar Lucas Lin Committed by Automerger Merge Worker
Browse files

Merge "Check if NetworkSpecifier is an instance of MatchAllNetworkSpecifier"...

Merge "Check if NetworkSpecifier is an instance of MatchAllNetworkSpecifier" am: ec3f650d am: b8275371 am: dbc70f90 am: 65fd64d4

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556546

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I337d48ff7e3e6aaf02270710362c0a89460c4275
parents 682d0b72 65fd64d4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -353,7 +353,9 @@ public class NetworkRequest implements Parcelable {
         *                         NetworkSpecifier.
         */
        public Builder setNetworkSpecifier(NetworkSpecifier networkSpecifier) {
            MatchAllNetworkSpecifier.checkNotMatchAllNetworkSpecifier(networkSpecifier);
            if (networkSpecifier instanceof MatchAllNetworkSpecifier) {
                throw new IllegalArgumentException("A MatchAllNetworkSpecifier is not permitted");
            }
            mNetworkCapabilities.setNetworkSpecifier(networkSpecifier);
            return this;
        }
+3 −1
Original line number Diff line number Diff line
@@ -5658,7 +5658,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
        if (ns == null) {
            return;
        }
        MatchAllNetworkSpecifier.checkNotMatchAllNetworkSpecifier(ns);
        if (ns instanceof MatchAllNetworkSpecifier) {
            throw new IllegalArgumentException("A MatchAllNetworkSpecifier is not permitted");
        }
    }

    private void ensureValid(NetworkCapabilities nc) {