Loading services/core/java/com/android/server/ConnectivityService.java +20 −0 Original line number Original line Diff line number Diff line Loading @@ -4597,9 +4597,28 @@ public class ConnectivityService extends IConnectivityManager.Stub } catch (Exception e) { } catch (Exception e) { loge("Exception in setDnsConfigurationForNetwork: " + e); loge("Exception in setDnsConfigurationForNetwork: " + e); } } final NetworkAgentInfo defaultNai = getDefaultNetwork(); if (defaultNai != null && defaultNai.network.netId == netId) { setDefaultDnsSystemProperties(dnses); } flushVmDnsCache(); flushVmDnsCache(); } } private void setDefaultDnsSystemProperties(Collection<InetAddress> dnses) { int last = 0; for (InetAddress dns : dnses) { ++last; String key = "net.dns" + last; String value = dns.getHostAddress(); SystemProperties.set(key, value); } for (int i = last + 1; i <= mNumDnsEntries; ++i) { String key = "net.dns" + i; SystemProperties.set(key, ""); } mNumDnsEntries = last; } private String getNetworkPermission(NetworkCapabilities nc) { private String getNetworkPermission(NetworkCapabilities nc) { // TODO: make these permission strings AIDL constants instead. // TODO: make these permission strings AIDL constants instead. if (!nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED)) { if (!nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED)) { Loading Loading @@ -4816,6 +4835,7 @@ public class ConnectivityService extends IConnectivityManager.Stub notifyLockdownVpn(newNetwork); notifyLockdownVpn(newNetwork); handleApplyDefaultProxy(newNetwork.linkProperties.getHttpProxy()); handleApplyDefaultProxy(newNetwork.linkProperties.getHttpProxy()); updateTcpBufferSizes(newNetwork); updateTcpBufferSizes(newNetwork); setDefaultDnsSystemProperties(newNetwork.linkProperties.getDnsServers()); } } private void processListenRequests(NetworkAgentInfo nai, boolean capabilitiesChanged) { private void processListenRequests(NetworkAgentInfo nai, boolean capabilitiesChanged) { Loading Loading
services/core/java/com/android/server/ConnectivityService.java +20 −0 Original line number Original line Diff line number Diff line Loading @@ -4597,9 +4597,28 @@ public class ConnectivityService extends IConnectivityManager.Stub } catch (Exception e) { } catch (Exception e) { loge("Exception in setDnsConfigurationForNetwork: " + e); loge("Exception in setDnsConfigurationForNetwork: " + e); } } final NetworkAgentInfo defaultNai = getDefaultNetwork(); if (defaultNai != null && defaultNai.network.netId == netId) { setDefaultDnsSystemProperties(dnses); } flushVmDnsCache(); flushVmDnsCache(); } } private void setDefaultDnsSystemProperties(Collection<InetAddress> dnses) { int last = 0; for (InetAddress dns : dnses) { ++last; String key = "net.dns" + last; String value = dns.getHostAddress(); SystemProperties.set(key, value); } for (int i = last + 1; i <= mNumDnsEntries; ++i) { String key = "net.dns" + i; SystemProperties.set(key, ""); } mNumDnsEntries = last; } private String getNetworkPermission(NetworkCapabilities nc) { private String getNetworkPermission(NetworkCapabilities nc) { // TODO: make these permission strings AIDL constants instead. // TODO: make these permission strings AIDL constants instead. if (!nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED)) { if (!nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED)) { Loading Loading @@ -4816,6 +4835,7 @@ public class ConnectivityService extends IConnectivityManager.Stub notifyLockdownVpn(newNetwork); notifyLockdownVpn(newNetwork); handleApplyDefaultProxy(newNetwork.linkProperties.getHttpProxy()); handleApplyDefaultProxy(newNetwork.linkProperties.getHttpProxy()); updateTcpBufferSizes(newNetwork); updateTcpBufferSizes(newNetwork); setDefaultDnsSystemProperties(newNetwork.linkProperties.getDnsServers()); } } private void processListenRequests(NetworkAgentInfo nai, boolean capabilitiesChanged) { private void processListenRequests(NetworkAgentInfo nai, boolean capabilitiesChanged) { Loading