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

Commit 168bfef1 authored by Erik Kline's avatar Erik Kline Committed by Android (Google) Code Review
Browse files

Merge "pass a defensive copy of DhcpResults" into mnc-dev

parents 417820bb d59aa84f
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ public class DhcpClient extends BaseDhcpStateMachine {

    private void notifyLease() {
        mController.sendMessage(DhcpStateMachine.CMD_POST_DHCP_ACTION,
                DhcpStateMachine.DHCP_SUCCESS, 0, mDhcpLease);
                DhcpStateMachine.DHCP_SUCCESS, 0, new DhcpResults(mDhcpLease));
    }

    private void notifyFailure() {
@@ -747,14 +747,15 @@ public class DhcpClient extends BaseDhcpStateMachine {
        @Override
        public void enter() {
            super.enter();
            if (!setIpAddress(mDhcpLease.ipAddress)) {
            if (setIpAddress(mDhcpLease.ipAddress)) {
                notifyLease();
                // TODO: DhcpStateMachine only supports renewing at 50% of the lease time,
                // and does not support rebinding. Fix this.
                scheduleRenew();
            } else {
                notifyFailure();
                transitionTo(mStoppedState);
            }
            notifyLease();
            // TODO: DhcpStateMachine only supports renewing at 50% of the lease time, and does not
            // support rebinding. Fix this.
            scheduleRenew();
        }

        @Override