diff options
| author | Sharvil Nanavati <sharvil@google.com> | 2014-04-02 20:36:57 -0700 |
|---|---|---|
| committer | Matthew Xie <mattx@google.com> | 2014-05-06 19:20:46 -0700 |
| commit | 37fce07bea8cd4a0b6b591d634cd09e225a8d672 (patch) | |
| tree | 6346efa5fdd890ac4e255c2fc2effcc8f6b1d038 /core/java/android/bluetooth/BluetoothTetheringDataTracker.java | |
| parent | 82500dd86631a08d290929f64824c4fd22f0aa75 (diff) | |
| download | frameworks_base-37fce07bea8cd4a0b6b591d634cd09e225a8d672.zip frameworks_base-37fce07bea8cd4a0b6b591d634cd09e225a8d672.tar.gz frameworks_base-37fce07bea8cd4a0b6b591d634cd09e225a8d672.tar.bz2 | |
Tear down PAN if we can't successfully complete a DHCP request
after establishing a PANU connection.
http://b/13731957
Change-Id: I0c808d5196c66783b52942ba7b7212bdce9f1c07
Diffstat (limited to 'core/java/android/bluetooth/BluetoothTetheringDataTracker.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothTetheringDataTracker.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java index 6dd551e..a0b603e 100644 --- a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java +++ b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java @@ -53,6 +53,9 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker { private static final boolean DBG = true; private static final boolean VDBG = true; + // Event sent to the mBtdtHandler when DHCP fails so we can tear down the network. + private static final int EVENT_NETWORK_FAILED = 1; + private AtomicBoolean mTeardownRequested = new AtomicBoolean(false); private AtomicBoolean mPrivateDnsRouteSet = new AtomicBoolean(false); private AtomicInteger mDefaultGatewayAddr = new AtomicInteger(0); @@ -315,6 +318,7 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker { } if (!success) { Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError()); + mBtdtHandler.obtainMessage(EVENT_NETWORK_FAILED).sendToTarget(); return; } mLinkProperties = dhcpResults.linkProperties; @@ -407,6 +411,10 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker { if (VDBG) Log.d(TAG, "got EVENT_NETWORK_DISCONNECTED, " + linkProperties); mBtdt.stopReverseTether(); break; + case EVENT_NETWORK_FAILED: + if (VDBG) Log.d(TAG, "got EVENT_NETWORK_FAILED"); + mBtdt.teardown(); + break; } } } |
