resolved conflicts for merge of 41394a36 to honeycomb-plus-aosp

Change-Id: Ic839eb7bd8081b94802dbbf9140b9d1fa0cf7df3
This commit is contained in:
Robert Greenwalt
2011-07-27 09:27:00 -07:00
3 changed files with 15 additions and 15 deletions

View File

@@ -235,12 +235,12 @@ interface INetworkManagementService
void setDnsServersForInterface(String iface, in String[] servers);
/**
* Flush the DNS cache associated with the default interface
* Flush the DNS cache associated with the default interface.
*/
void flushDefaultDnsCache();
/**
* Flush the DNS cache associated with the specified interface
* Flush the DNS cache associated with the specified interface.
*/
void flushInterfaceDnsCache(String iface);
}

View File

@@ -1785,13 +1785,18 @@ public class ConnectivityService extends IConnectivityManager.Stub {
if (p == null) return;
Collection<InetAddress> dnses = p.getDnses();
try {
mNetd.setDnsServersForInterface(Integer.toString(netType),
mNetd.setDnsServersForInterface(p.getInterfaceName(),
NetworkUtils.makeStrings(dnses));
} catch (Exception e) {
Slog.e(TAG, "exception setting dns servers: " + e);
}
boolean changed = false;
if (mNetConfigs[netType].isDefault()) {
try {
mNetd.setDefaultInterfaceForDns(p.getInterfaceName());
} catch (Exception e) {
Slog.e(TAG, "exception setting default dns interface: " + e);
}
int j = 1;
if (dnses.size() == 0 && mDefaultDns != null) {
String dnsString = mDefaultDns.getHostAddress();
@@ -1818,10 +1823,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
SystemProperties.set("net.dns" + j++, dnsString);
}
}
try {
mNetd.setDefaultInterfaceForDns(Integer.toString(netType));
} catch (Exception e) {
Slog.e(TAG, "exception setting default dns interface: " + e);}
for (int k=j ; k<mNumDnsEntries; k++) {
if (changed || !TextUtils.isEmpty(SystemProperties.get("net.dns" + k))) {
if (DBG) log("erasing net.dns" + k);

View File

@@ -970,18 +970,17 @@ class NetworkManagementService extends INetworkManagementService.Stub {
try {
String cmd = "resolver setifdns " + iface;
for (String s : servers) {
if (s != null && !"0.0.0.0".equals(s) &&
!"::".equals(s) && !"0:0:0:0:0:0:0:0".equals(s)) {
cmd += " " + InetAddress.getByName(s).getHostAddress();
InetAddress a = NetworkUtils.numericToInetAddress(s);
if (a.isAnyLocalAddress() == false) {
cmd += " " + a.getHostAddress();
}
}
mConnector.doCommand(cmd);
} catch (UnknownHostException e) {
throw new IllegalStateException("failed to resolve dns address.", e);
} catch (IllegalArgumentException e) {
throw new IllegalStateException("Error setting dnsn for interface", e);
} catch (NativeDaemonConnectorException e) {
throw new IllegalStateException(
"Error communicating with native deamon to set dns for interface", e);
"Error communicating with native daemon to set dns for interface", e);
}
}
@@ -1007,7 +1006,7 @@ class NetworkManagementService extends INetworkManagementService.Stub {
mConnector.doCommand(cmd);
} catch (NativeDaemonConnectorException e) {
throw new IllegalStateException(
"Error communicating with native deamon to flush interface " + iface, e);
"Error communicating with native daemon to flush interface " + iface, e);
}
}
}