summaryrefslogtreecommitdiffstats
path: root/services/net
diff options
context:
space:
mode:
authorErik Kline <ek@google.com>2015-06-02 15:51:45 +0900
committerErik Kline <ek@google.com>2015-06-02 16:22:57 +0900
commitd59aa84fdaea9647f7de82c3b85afc92a3fdfee1 (patch)
treec1007db58dece07ebde4a37812e4aa8300293881 /services/net
parent11df5b66ef621c4d67f5b4980e879784de43fd70 (diff)
downloadframeworks_base-d59aa84fdaea9647f7de82c3b85afc92a3fdfee1.zip
frameworks_base-d59aa84fdaea9647f7de82c3b85afc92a3fdfee1.tar.gz
frameworks_base-d59aa84fdaea9647f7de82c3b85afc92a3fdfee1.tar.bz2
pass a defensive copy of DhcpResults
Also: correct state transition handling in DhcpBoundState#enter(). Bug: 20451261 Change-Id: I3be50f6b1b3fae179d6fff7ca8ae1d687caa3221
Diffstat (limited to 'services/net')
-rw-r--r--services/net/java/android/net/dhcp/DhcpClient.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/services/net/java/android/net/dhcp/DhcpClient.java b/services/net/java/android/net/dhcp/DhcpClient.java
index 316496f..2692d71 100644
--- a/services/net/java/android/net/dhcp/DhcpClient.java
+++ b/services/net/java/android/net/dhcp/DhcpClient.java
@@ -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