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

Commit e3f76635 authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

Merge "Push DNS configuration on network validation"

am: ef941e19

Change-Id: I5907831e5f5f1f3659580cc56e2e081cbe88b1cc
parents d111501e ef941e19
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2229,6 +2229,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                        updateCapabilities(oldScore, nai, nai.networkCapabilities);
                        // If score has changed, rebroadcast to NetworkFactories. b/17726566
                        if (oldScore != nai.getCurrentScore()) sendUpdatedScoreToFactories(nai);
                        if (valid) handleFreshlyValidatedNetwork(nai);
                    }
                    updateInetCondition(nai);
                    // Let the NetworkAgent know the state of its network
@@ -2323,6 +2324,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
                mDefaultRequest.networkCapabilities, nai.networkCapabilities);
    }

    private void handleFreshlyValidatedNetwork(NetworkAgentInfo nai) {
        if (nai == null) return;
        // If the Private DNS mode is opportunistic, reprogram the DNS servers
        // in order to restart a validation pass from within netd.
        final PrivateDnsConfig cfg = mDnsManager.getPrivateDnsConfig();
        if (cfg.useTls && TextUtils.isEmpty(cfg.hostname)) {
            updateDnses(nai.linkProperties, null, nai.network.netId);
        }
    }

    private void handlePrivateDnsSettingsChanged() {
        final PrivateDnsConfig cfg = mDnsManager.getPrivateDnsConfig();