diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-01-14 16:29:58 -0800 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2011-01-26 09:10:01 -0800 |
commit | 0216e618198393bfd7ac0625fa6ad251d5ea682f (patch) | |
tree | 37f7e657a009a80e7a80398022f7fd4cc2dc3e4a /core/java/android/bluetooth/BluetoothTetheringDataTracker.java | |
parent | 6ec87ea08a9c67fc823aa899d12c349f8fcad51e (diff) | |
download | frameworks_base-0216e618198393bfd7ac0625fa6ad251d5ea682f.zip frameworks_base-0216e618198393bfd7ac0625fa6ad251d5ea682f.tar.gz frameworks_base-0216e618198393bfd7ac0625fa6ad251d5ea682f.tar.bz2 |
Make the interface with DHCP IPv6 capable.
It doesn't work (yet) for IPv6, but we can remove v4-centric notions from the framework.
bug:2542681
Change-Id: I21c058f5c88d07706c9265bf0ea902fc90357e56
Diffstat (limited to 'core/java/android/bluetooth/BluetoothTetheringDataTracker.java')
-rw-r--r-- | core/java/android/bluetooth/BluetoothTetheringDataTracker.java | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java index 7b083f1..aa1adcb 100644 --- a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java +++ b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java @@ -18,7 +18,7 @@ package android.bluetooth; import android.content.Context; import android.net.ConnectivityManager; -import android.net.DhcpInfo; +import android.net.DhcpInfoInternal; import android.net.LinkAddress; import android.net.LinkCapabilities; import android.net.LinkProperties; @@ -251,23 +251,12 @@ public class BluetoothTetheringDataTracker implements NetworkStateTracker { public void run() { //TODO(): Add callbacks for failure and success case. //Currently this thread runs independently. - DhcpInfo dhcpInfo = new DhcpInfo(); - if (!NetworkUtils.runDhcp(mIface, dhcpInfo)) { + DhcpInfoInternal dhcpInfoInternal = new DhcpInfoInternal(); + if (!NetworkUtils.runDhcp(mIface, dhcpInfoInternal)) { Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError()); return; } - mLinkProperties.addLinkAddress(new LinkAddress( - NetworkUtils.intToInetAddress(dhcpInfo.ipAddress), - NetworkUtils.intToInetAddress(dhcpInfo.netmask))); - mLinkProperties.setGateway(NetworkUtils.intToInetAddress(dhcpInfo.gateway)); - InetAddress dns1Addr = NetworkUtils.intToInetAddress(dhcpInfo.dns1); - if (dns1Addr == null || dns1Addr.equals("0.0.0.0")) { - mLinkProperties.addDns(dns1Addr); - } - InetAddress dns2Addr = NetworkUtils.intToInetAddress(dhcpInfo.dns2); - if (dns2Addr == null || dns2Addr.equals("0.0.0.0")) { - mLinkProperties.addDns(dns2Addr); - } + mLinkProperties = dhcpInfoInternal.makeLinkProperties(); mLinkProperties.setInterfaceName(mIface); mNetworkInfo.setIsAvailable(true); |