summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2010-10-01 16:08:28 -0700
committerIrfan Sheriff <isheriff@google.com>2010-10-06 11:04:05 -0700
commited5d7d17c9e9837ce7a6a10698cce9f6e4101acd (patch)
treef92135dd4aea005231596dc69a813a88eb1ebf63 /wifi
parent32e60fbea7888dcc4cb9612f27674888bb56f9c3 (diff)
downloadframeworks_base-ed5d7d17c9e9837ce7a6a10698cce9f6e4101acd.zip
frameworks_base-ed5d7d17c9e9837ce7a6a10698cce9f6e4101acd.tar.gz
frameworks_base-ed5d7d17c9e9837ce7a6a10698cce9f6e4101acd.tar.bz2
Add LinkAddress
LinkAddress stores IP address + prefix for a network link Change-Id: Id3e74e9d0a62121d097ebdc9be064eeea257ba1f
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 6c5aa1d..572abc0 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -38,6 +38,7 @@ import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLING;
import static android.net.wifi.WifiManager.WIFI_AP_STATE_FAILED;
import android.app.ActivityManagerNative;
+import android.net.LinkAddress;
import android.net.NetworkInfo;
import android.net.DhcpInfo;
import android.net.NetworkUtils;
@@ -1252,19 +1253,14 @@ public class WifiStateMachine extends HierarchicalStateMachine {
}
private void configureLinkProperties() {
- try {
- mLinkProperties.setInterface(NetworkInterface.getByName(mInterfaceName));
- } catch (SocketException e) {
- Log.e(TAG, "SocketException creating NetworkInterface from " + mInterfaceName +
- ". e=" + e);
- return;
- } catch (NullPointerException e) {
- Log.e(TAG, "NPE creating NetworkInterface. e=" + e);
- return;
- }
+
+ mLinkProperties.setInterfaceName(mInterfaceName);
+
// TODO - fix this for v6
synchronized (mDhcpInfo) {
- mLinkProperties.addAddress(NetworkUtils.intToInetAddress(mDhcpInfo.ipAddress));
+ mLinkProperties.addLinkAddress(new LinkAddress(
+ NetworkUtils.intToInetAddress(mDhcpInfo.ipAddress),
+ NetworkUtils.intToInetAddress(mDhcpInfo.netmask)));
mLinkProperties.setGateway(NetworkUtils.intToInetAddress(mDhcpInfo.gateway));
mLinkProperties.addDns(NetworkUtils.intToInetAddress(mDhcpInfo.dns1));
mLinkProperties.addDns(NetworkUtils.intToInetAddress(mDhcpInfo.dns2));