diff options
author | Wink Saville <wink@google.com> | 2010-01-04 21:54:25 -0800 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2010-01-04 21:54:25 -0800 |
commit | 6aa8a21bb48ee6fe8fb496ede609727131837a6e (patch) | |
tree | d1ae1c6d32c04cb56875336ccadea8029ab95012 /telephony | |
parent | 1337b012f8e18c725b1ec17b456dc57a084d594d (diff) | |
download | frameworks_base-6aa8a21bb48ee6fe8fb496ede609727131837a6e.zip frameworks_base-6aa8a21bb48ee6fe8fb496ede609727131837a6e.tar.gz frameworks_base-6aa8a21bb48ee6fe8fb496ede609727131837a6e.tar.bz2 |
Fix data connection support on emulator.
Bug: 2353316
Change-Id: I34765c70fc6ef160956d400647565c577141c0bf
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/DataConnection.java | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java index cf06173..a01bc09 100644 --- a/telephony/java/com/android/internal/telephony/DataConnection.java +++ b/telephony/java/com/android/internal/telephony/DataConnection.java @@ -389,31 +389,39 @@ public abstract class DataConnection extends HierarchicalStateMachine { } result = SetupResult.ERR_Stale; } else { - cid = Integer.parseInt(response[0]); - if (response.length > 2) { +// log("onSetupConnectionCompleted received " + response.length + " response strings:"); +// for (int i = 0; i < response.length; i++) { +// log(" response[" + i + "]='" + response[i] + "'"); +// } + if (response.length >= 2) { + cid = Integer.parseInt(response[0]); interfaceName = response[1]; - 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 (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; + if (isDnsOk(dnsServers)) { + result = SetupResult.SUCCESS; + } else { + result = SetupResult.ERR_BadDns; + } } else { - result = SetupResult.ERR_BadDns; + result = SetupResult.SUCCESS; } } else { result = SetupResult.ERR_Other; } } - if (DBG) log("DataConnection setup result=" + result + " on cid = " + cid); + if (DBG) log("DataConnection setup result='" + result + "' on cid=" + cid); return result; } |