summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Greenwalt <robdroid@android.com> 2010-07-16 18:14:25 -0700
committer Robert Greenwalt <robdroid@android.com> 2010-07-16 18:14:25 -0700
commit6fefb33a672af97936eec322b416537da182434c (patch)
treebc4578a522bdaabfb50b77034c6a770ec1fe750c
parent11811612e8411f926d7f325be6321316a4e10f6d (diff)
Fix emulator dns.
Really fix it this time. The previous fix had a flaw which tested ok but was removed after a code review. This flaw masked problems in DataConnection, which this fix fixes. bug:2849192 Change-Id: I50d2dd827d4427f8030c0f590c85672869b509ff
-rw-r--r--telephony/java/com/android/internal/telephony/DataConnection.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java
index 6634017c84a5..13c76e50fb0a 100644
--- a/telephony/java/com/android/internal/telephony/DataConnection.java
+++ b/telephony/java/com/android/internal/telephony/DataConnection.java
@@ -419,17 +419,14 @@ public abstract class DataConnection extends HierarchicalStateMachine {
if (response.length >= 2) {
cid = Integer.parseInt(response[0]);
interfaceName = response[1];
+
+ String prefix = "net." + interfaceName + ".";
+ gatewayAddress = SystemProperties.get(prefix + "gw");
+ dnsServers[0] = SystemProperties.get(prefix + "dns1");
+ dnsServers[1] = SystemProperties.get(prefix + "dns2");
+
if (response.length > 2) {
ipAddress = response[2];
- String prefix = "net." + interfaceName + ".";
- gatewayAddress = SystemProperties.get(prefix + "gw");
- dnsServers[0] = SystemProperties.get(prefix + "dns1");
- dnsServers[1] = SystemProperties.get(prefix + "dns2");
- if (DBG) {
- log("interface=" + interfaceName + " ipAddress=" + ipAddress
- + " gateway=" + gatewayAddress + " DNS1=" + dnsServers[0]
- + " DNS2=" + dnsServers[1]);
- }
if (isDnsOk(dnsServers)) {
result = SetupResult.SUCCESS;
@@ -444,7 +441,14 @@ public abstract class DataConnection extends HierarchicalStateMachine {
}
}
- if (DBG) log("DataConnection setup result='" + result + "' on cid=" + cid);
+ if (DBG) {
+ log("DataConnection setup result='" + result + "' on cid=" + cid);
+ if (result == SetupResult.SUCCESS) {
+ log("interface=" + interfaceName + " ipAddress=" + ipAddress
+ + " gateway=" + gatewayAddress + " DNS1=" + dnsServers[0]
+ + " DNS2=" + dnsServers[1]);
+ }
+ }
return result;
}