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

Commit b9c95566 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Add support for infinite dhcp lease time

Bug: 5649076
Change-Id: I29e3b41d8bd1173b155f3173e65a3b45ad17a45c
parent 38bc7318
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();