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

Commit 6f192a5b authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Don't complain if a VPN changes capabilities.

VPNs are not driven by NetworkRequests, so there's no risk of a
capability change on a VPN causing a connect/teardown loop.

Bug: 80439912
Test: builds, boots
Change-Id: Ic4c489ccc9fb97551d1ef440766f6cf6f99522db
parent 7c0e462b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4868,7 +4868,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
     */
    private NetworkCapabilities mixInCapabilities(NetworkAgentInfo nai, NetworkCapabilities nc) {
        // Once a NetworkAgent is connected, complain if some immutable capabilities are removed.
         // Don't complain for VPNs since they're not driven by requests and there is no risk of
         // causing a connect/teardown loop.
         // TODO: remove this altogether and make it the responsibility of the NetworkFactories to
         // avoid connect/teardown loops.
        if (nai.everConnected &&
                !nai.isVPN() &&
                !nai.networkCapabilities.satisfiedByImmutableNetworkCapabilities(nc)) {
            // TODO: consider not complaining when a network agent degrades its capabilities if this
            // does not cause any request (that is not a listen) currently matching that agent to