Push DNS configuration on network validation
Test: as follows
- built, flashed, booted
- runtest frameworks-net passes
- connected to captive portal network,
saw failed validation attempt (opportunistic),
passed portal, saw successful revalidation attempt
Bug: 64133961
Bug: 72344805
Bug: 109928338
Change-Id: I0471685c2234af8a8c7f5b2ad3205eb6e36333c5
This commit is contained in:
@@ -2191,6 +2191,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
updateCapabilities(oldScore, nai, nai.networkCapabilities);
|
updateCapabilities(oldScore, nai, nai.networkCapabilities);
|
||||||
// If score has changed, rebroadcast to NetworkFactories. b/17726566
|
// If score has changed, rebroadcast to NetworkFactories. b/17726566
|
||||||
if (oldScore != nai.getCurrentScore()) sendUpdatedScoreToFactories(nai);
|
if (oldScore != nai.getCurrentScore()) sendUpdatedScoreToFactories(nai);
|
||||||
|
if (valid) handleFreshlyValidatedNetwork(nai);
|
||||||
}
|
}
|
||||||
updateInetCondition(nai);
|
updateInetCondition(nai);
|
||||||
// Let the NetworkAgent know the state of its network
|
// Let the NetworkAgent know the state of its network
|
||||||
@@ -2285,6 +2286,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
mDefaultRequest.networkCapabilities, nai.networkCapabilities);
|
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() {
|
private void handlePrivateDnsSettingsChanged() {
|
||||||
final PrivateDnsConfig cfg = mDnsManager.getPrivateDnsConfig();
|
final PrivateDnsConfig cfg = mDnsManager.getPrivateDnsConfig();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user