summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-06-21 11:01:54 -0700
committerIrfan Sheriff <isheriff@google.com>2011-06-21 11:01:54 -0700
commit7dd120058972226158176b292c00841efecc259f (patch)
treef100d4c6860b3f950f0658302a035e032a8c56dc /core
parent444336dd5f233c59e5a222d366d2498c888664b5 (diff)
downloadframeworks_base-7dd120058972226158176b292c00841efecc259f.zip
frameworks_base-7dd120058972226158176b292c00841efecc259f.tar.gz
frameworks_base-7dd120058972226158176b292c00841efecc259f.tar.bz2
DO NOT MERGE Revert "Fix lease duration handling"
This reverts commit 56878760c3f0255dbcc8d78572f784b96ee36cb0.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/net/DhcpStateMachine.java25
1 files changed, 7 insertions, 18 deletions
diff --git a/core/java/android/net/DhcpStateMachine.java b/core/java/android/net/DhcpStateMachine.java
index e2230c9..f5cf14b 100644
--- a/core/java/android/net/DhcpStateMachine.java
+++ b/core/java/android/net/DhcpStateMachine.java
@@ -66,9 +66,6 @@ public class DhcpStateMachine extends HierarchicalStateMachine {
private static final int DHCP_RENEW = 0;
private static final String ACTION_DHCP_RENEW = "android.net.wifi.DHCP_RENEW";
- //Used for sanity check on setting up renewal
- private static final int MIN_RENEWAL_TIME_SECS = 5 * 60; // 5 minutes
-
private enum DhcpAction {
START,
RENEW
@@ -334,21 +331,13 @@ public class DhcpStateMachine extends HierarchicalStateMachine {
if (success) {
Log.d(TAG, "DHCP succeeded on " + mInterfaceName);
- long leaseDuration = dhcpInfoInternal.leaseDuration; //int to long conversion
-
- //Sanity check for renewal
- //TODO: would be good to notify the user that his network configuration is
- //bad and that the device cannot renew below MIN_RENEWAL_TIME_SECS
- if (leaseDuration < MIN_RENEWAL_TIME_SECS) {
- leaseDuration = MIN_RENEWAL_TIME_SECS;
- }
- //Do it a bit earlier than half the lease duration time
- //to beat the native DHCP client and avoid extra packets
- //48% for one hour lease time = 29 minutes
- mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
- SystemClock.elapsedRealtime() +
- leaseDuration * 480, //in milliseconds
- mDhcpRenewalIntent);
+ //Do it a bit earlier than half the lease duration time
+ //to beat the native DHCP client and avoid extra packets
+ //48% for one hour lease time = 29 minutes
+ mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+ SystemClock.elapsedRealtime() +
+ dhcpInfoInternal.leaseDuration * 480, //in milliseconds
+ mDhcpRenewalIntent);
mController.obtainMessage(CMD_POST_DHCP_ACTION, DHCP_SUCCESS, 0, dhcpInfoInternal)
.sendToTarget();