diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-03-02 12:10:51 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-02 12:10:51 -0800 |
commit | 7e48e76cab10377367b925790cf3a840651009fa (patch) | |
tree | 74833222c8eeb9fd4c53711b61999d30761de74a /wifi/java/android | |
parent | 76bb1200c2ea08665f33fb0d54023113c19b8286 (diff) | |
parent | e590373ea71251cfffc8f22f011e2e6335dce716 (diff) | |
download | frameworks_base-7e48e76cab10377367b925790cf3a840651009fa.zip frameworks_base-7e48e76cab10377367b925790cf3a840651009fa.tar.gz frameworks_base-7e48e76cab10377367b925790cf3a840651009fa.tar.bz2 |
Merge "Start using NetworkUtils.numericToInetAddress."
Diffstat (limited to 'wifi/java/android')
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfigStore.java | 12 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index d411715..f6317f5 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -686,13 +686,15 @@ class WifiConfigStore { } else if (key.equals(IP_ASSIGNMENT_KEY)) { ipAssignment = IpAssignment.valueOf(in.readUTF()); } else if (key.equals(LINK_ADDRESS_KEY)) { - LinkAddress linkAddr = new LinkAddress(InetAddress.getByName( - in.readUTF()), in.readInt()); + LinkAddress linkAddr = new LinkAddress( + NetworkUtils.numericToInetAddress(in.readUTF()), in.readInt()); linkProperties.addLinkAddress(linkAddr); } else if (key.equals(GATEWAY_KEY)) { - linkProperties.addGateway(InetAddress.getByName(in.readUTF())); + linkProperties.addGateway( + NetworkUtils.numericToInetAddress(in.readUTF())); } else if (key.equals(DNS_KEY)) { - linkProperties.addDns(InetAddress.getByName(in.readUTF())); + linkProperties.addDns( + NetworkUtils.numericToInetAddress(in.readUTF())); } else if (key.equals(PROXY_SETTINGS_KEY)) { proxySettings = ProxySettings.valueOf(in.readUTF()); } else if (key.equals(PROXY_HOST_KEY)) { @@ -706,7 +708,7 @@ class WifiConfigStore { } else { Log.e(TAG, "Ignore unknown key " + key + "while reading"); } - } catch (UnknownHostException e) { + } catch (IllegalArgumentException e) { Log.e(TAG, "Ignore invalid address while reading" + e); } } while (true); diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index d6f8e51..e89858c 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -996,7 +996,8 @@ public class WifiStateMachine extends HierarchicalStateMachine { ifcg = service.getInterfaceConfig(intf); if (ifcg != null) { /* IP/netmask: 192.168.43.1/255.255.255.0 */ - ifcg.addr = new LinkAddress(InetAddress.getByName("192.168.43.1"), 24); + ifcg.addr = new LinkAddress(NetworkUtils.numericToInetAddress( + "192.168.43.1"), 24); ifcg.interfaceFlags = "[up]"; service.setInterfaceConfig(intf, ifcg); |