Merge "DO NOT MERGE Tear down PAN if we can't successfully complete a DHCP request after establishing a PANU connection." into klp-modular-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fe7550548d
@@ -61,6 +61,9 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker {
|
|||||||
private static final boolean DBG = true;
|
private static final boolean DBG = true;
|
||||||
private static final boolean VDBG = 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 mTeardownRequested = new AtomicBoolean(false);
|
||||||
private AtomicBoolean mPrivateDnsRouteSet = new AtomicBoolean(false);
|
private AtomicBoolean mPrivateDnsRouteSet = new AtomicBoolean(false);
|
||||||
private AtomicInteger mDefaultGatewayAddr = new AtomicInteger(0);
|
private AtomicInteger mDefaultGatewayAddr = new AtomicInteger(0);
|
||||||
@@ -328,6 +331,7 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker {
|
|||||||
}
|
}
|
||||||
if (!success) {
|
if (!success) {
|
||||||
Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError());
|
Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError());
|
||||||
|
mBtdtHandler.obtainMessage(EVENT_NETWORK_FAILED).sendToTarget();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mLinkProperties = dhcpResults.linkProperties;
|
mLinkProperties = dhcpResults.linkProperties;
|
||||||
@@ -420,6 +424,10 @@ public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker {
|
|||||||
if (VDBG) Log.d(TAG, "got EVENT_NETWORK_DISCONNECTED, " + linkProperties);
|
if (VDBG) Log.d(TAG, "got EVENT_NETWORK_DISCONNECTED, " + linkProperties);
|
||||||
mBtdt.stopReverseTether();
|
mBtdt.stopReverseTether();
|
||||||
break;
|
break;
|
||||||
|
case EVENT_NETWORK_FAILED:
|
||||||
|
if (VDBG) Log.d(TAG, "got EVENT_NETWORK_FAILED");
|
||||||
|
mBtdt.teardown();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user