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

Commit ec3f650d authored by Lucas Lin's avatar Lucas Lin Committed by Gerrit Code Review
Browse files

Merge "Check if NetworkSpecifier is an instance of MatchAllNetworkSpecifier"

parents 2befe56d eb1c486a
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) {