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

Commit c15225f9 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Add support for infinite dhcp lease time"

parents fc6cf288 b9c95566
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ public class DhcpStateMachine extends StateMachine {
            long leaseDuration = dhcpInfoInternal.leaseDuration; //int to long conversion

            //Sanity check for renewal
            if (leaseDuration >= 0) {
                //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) {
@@ -362,6 +363,9 @@ public class DhcpStateMachine extends StateMachine {
                        SystemClock.elapsedRealtime() +
                        leaseDuration * 480, //in milliseconds
                        mDhcpRenewalIntent);
            } else {
                //infinite lease time, no renewal needed
            }

            mController.obtainMessage(CMD_POST_DHCP_ACTION, DHCP_SUCCESS, 0, dhcpInfoInternal)
                .sendToTarget();