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

Commit 9634abe8 authored by Jeff Davidson's avatar Jeff Davidson
Browse files

Update network selections on capability change.

Among other reasons, this is needed when a Wi-Fi connection is
upgraded from untrusted to trusted, so that the default route can be
updated to point to the Wi-Fi network instead.

Bug: 18206275
Change-Id: I53f7a6f00f66a23ae4873fa2334cd8a621f39d4f
parent a8d83d63
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -3701,12 +3701,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {


    private void updateCapabilities(NetworkAgentInfo networkAgent,
    private void updateCapabilities(NetworkAgentInfo networkAgent,
            NetworkCapabilities networkCapabilities) {
            NetworkCapabilities networkCapabilities) {
        //  TODO - turn this on in MR1 when we have more dogfooding time.
        // rematchAllNetworksAndRequests();
        if (!Objects.equals(networkAgent.networkCapabilities, networkCapabilities)) {
        if (!Objects.equals(networkAgent.networkCapabilities, networkCapabilities)) {
            synchronized (networkAgent) {
            synchronized (networkAgent) {
                networkAgent.networkCapabilities = networkCapabilities;
                networkAgent.networkCapabilities = networkCapabilities;
            }
            }
            rematchAllNetworksAndRequests(networkAgent, networkAgent.getCurrentScore());
            notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_CAP_CHANGED);
            notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_CAP_CHANGED);
        }
        }
    }
    }