Loading core/java/android/os/INetworkManagementService.aidl +0 −5 Original line number Diff line number Diff line Loading @@ -328,11 +328,6 @@ interface INetworkManagementService */ void setDnsServersForNetwork(int netId, in String[] servers, String domains); /** * Flush the DNS cache associated with the specified network. */ void flushNetworkDnsCache(int netId); void setFirewallEnabled(boolean enabled); boolean isFirewallEnabled(); void setFirewallInterfaceRule(String iface, boolean allow); Loading services/core/java/com/android/server/ConnectivityService.java +19 −25 Original line number Diff line number Diff line Loading @@ -4134,8 +4134,8 @@ public class ConnectivityService extends IConnectivityManager.Stub // } updateTcpBufferSizes(networkAgent); final boolean flushDns = updateRoutes(newLp, oldLp, netId); updateDnses(newLp, oldLp, netId, flushDns); updateRoutes(newLp, oldLp, netId); updateDnses(newLp, oldLp, netId); updateClat(newLp, oldLp, networkAgent); if (isDefaultNetwork(networkAgent)) { Loading Loading @@ -4238,14 +4238,16 @@ public class ConnectivityService extends IConnectivityManager.Stub return !routeDiff.added.isEmpty() || !routeDiff.removed.isEmpty(); } private void updateDnses(LinkProperties newLp, LinkProperties oldLp, int netId, boolean flush) { if (oldLp == null || (newLp.isIdenticalDnses(oldLp) == false)) { private void updateDnses(LinkProperties newLp, LinkProperties oldLp, int netId) { if (oldLp != null && newLp.isIdenticalDnses(oldLp)) { return; // no updating necessary } Collection<InetAddress> dnses = newLp.getDnsServers(); if (DBG) log("Setting Dns servers for network " + netId + " to " + dnses); try { mNetd.setDnsServersForNetwork(netId, NetworkUtils.makeStrings(dnses), newLp.getDomains()); mNetd.setDnsServersForNetwork( netId, NetworkUtils.makeStrings(dnses), newLp.getDomains()); } catch (Exception e) { loge("Exception in setDnsServersForNetwork: " + e); } Loading @@ -4254,14 +4256,6 @@ public class ConnectivityService extends IConnectivityManager.Stub setDefaultDnsSystemProperties(dnses); } flushVmDnsCache(); } else if (flush) { try { mNetd.flushNetworkDnsCache(netId); } catch (Exception e) { loge("Exception in flushNetworkDnsCache: " + e); } flushVmDnsCache(); } } private void setDefaultDnsSystemProperties(Collection<InetAddress> dnses) { Loading services/core/java/com/android/server/NetworkManagementService.java +0 −10 Original line number Diff line number Diff line Loading @@ -1936,16 +1936,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub } } @Override public void flushNetworkDnsCache(int netId) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); try { mConnector.execute("resolver", "flushnet", netId); } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } } @Override public void setFirewallEnabled(boolean enabled) { enforceSystemUid(); Loading Loading
core/java/android/os/INetworkManagementService.aidl +0 −5 Original line number Diff line number Diff line Loading @@ -328,11 +328,6 @@ interface INetworkManagementService */ void setDnsServersForNetwork(int netId, in String[] servers, String domains); /** * Flush the DNS cache associated with the specified network. */ void flushNetworkDnsCache(int netId); void setFirewallEnabled(boolean enabled); boolean isFirewallEnabled(); void setFirewallInterfaceRule(String iface, boolean allow); Loading
services/core/java/com/android/server/ConnectivityService.java +19 −25 Original line number Diff line number Diff line Loading @@ -4134,8 +4134,8 @@ public class ConnectivityService extends IConnectivityManager.Stub // } updateTcpBufferSizes(networkAgent); final boolean flushDns = updateRoutes(newLp, oldLp, netId); updateDnses(newLp, oldLp, netId, flushDns); updateRoutes(newLp, oldLp, netId); updateDnses(newLp, oldLp, netId); updateClat(newLp, oldLp, networkAgent); if (isDefaultNetwork(networkAgent)) { Loading Loading @@ -4238,14 +4238,16 @@ public class ConnectivityService extends IConnectivityManager.Stub return !routeDiff.added.isEmpty() || !routeDiff.removed.isEmpty(); } private void updateDnses(LinkProperties newLp, LinkProperties oldLp, int netId, boolean flush) { if (oldLp == null || (newLp.isIdenticalDnses(oldLp) == false)) { private void updateDnses(LinkProperties newLp, LinkProperties oldLp, int netId) { if (oldLp != null && newLp.isIdenticalDnses(oldLp)) { return; // no updating necessary } Collection<InetAddress> dnses = newLp.getDnsServers(); if (DBG) log("Setting Dns servers for network " + netId + " to " + dnses); try { mNetd.setDnsServersForNetwork(netId, NetworkUtils.makeStrings(dnses), newLp.getDomains()); mNetd.setDnsServersForNetwork( netId, NetworkUtils.makeStrings(dnses), newLp.getDomains()); } catch (Exception e) { loge("Exception in setDnsServersForNetwork: " + e); } Loading @@ -4254,14 +4256,6 @@ public class ConnectivityService extends IConnectivityManager.Stub setDefaultDnsSystemProperties(dnses); } flushVmDnsCache(); } else if (flush) { try { mNetd.flushNetworkDnsCache(netId); } catch (Exception e) { loge("Exception in flushNetworkDnsCache: " + e); } flushVmDnsCache(); } } private void setDefaultDnsSystemProperties(Collection<InetAddress> dnses) { Loading
services/core/java/com/android/server/NetworkManagementService.java +0 −10 Original line number Diff line number Diff line Loading @@ -1936,16 +1936,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub } } @Override public void flushNetworkDnsCache(int netId) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); try { mConnector.execute("resolver", "flushnet", netId); } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } } @Override public void setFirewallEnabled(boolean enabled) { enforceSystemUid(); Loading