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

Commit 0257c82f authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android Git Automerger
Browse files

am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t...

am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev

* commit '11e84bde':
  Don't mark NetworkRequests restricted when they don't have restricted caps
parents 06a86644 11e84bde
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -351,9 +351,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
+1 −2
Original line number Diff line number Diff line
@@ -943,8 +943,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
        if (capability == NET_CAPABILITY_CBS || capability == NET_CAPABILITY_DUN ||
                capability == NET_CAPABILITY_EIMS || capability == NET_CAPABILITY_FOTA ||
                capability == NET_CAPABILITY_IA || capability == NET_CAPABILITY_IMS ||
                capability == NET_CAPABILITY_RCS || capability == NET_CAPABILITY_XCAP ||
                capability == NET_CAPABILITY_TRUSTED || capability == NET_CAPABILITY_NOT_VPN) {
                capability == NET_CAPABILITY_RCS || capability == NET_CAPABILITY_XCAP) {
            assertFalse(nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));
        } else {
            assertTrue(nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));