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

Commit ece4ac21 authored by Paul Jensen's avatar Paul Jensen Committed by Android (Google) Code Review
Browse files

Merge "Don't mark NetworkRequests restricted when they don't have restricted caps" into lmp-dev

parents a9e98343 2b6af396
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -285,9 +285,13 @@ public final class NetworkCapabilities implements Parcelable {
    public void maybeMarkCapabilitiesRestricted() {
        // If all the capabilities are typically provided by restricted networks, conclude that this
        // network is restricted.
        if ((mNetworkCapabilities & ~(DEFAULT_CAPABILITIES | RESTRICTED_CAPABILITIES)) == 0)
        if ((mNetworkCapabilities & ~(DEFAULT_CAPABILITIES | RESTRICTED_CAPABILITIES)) == 0 &&
                // Must have at least some restricted capabilities, otherwise a request for an
                // internet-less network will get marked restricted.
                (mNetworkCapabilities & RESTRICTED_CAPABILITIES) != 0) {
            removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
        }
    }

    /**
     * Representing the transport type.  Apps should generally not care about transport.  A