Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8b17b90 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Don't renew the leases if mDhcpInfo.leaseDuration is not positive" into gingerbread

parents e52109d6 818cbe49
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2527,10 +2527,13 @@ public class WifiStateTracker extends NetworkStateTracker {
                            //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
                            //Don't do it if we're on an infinite lease
                            if (mDhcpInfo.leaseDuration >= 0) {
                                mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                                        SystemClock.elapsedRealtime() +
                                        mDhcpInfo.leaseDuration * 480, //in milliseconds
                                        mDhcpRenewalIntent);
                            }
                        } else {
                            event = EVENT_INTERFACE_CONFIGURATION_FAILED;
                            Log.e(TAG, "DHCP request failed: " + NetworkUtils.getDhcpError());