summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Li <lifr@google.com>2020-06-23 01:27:42 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-23 01:27:42 +0000
commitbab27c2df8e2e62b16da745b16764a63e8b2110a (patch)
treeca7000e839a46d672870f0e6b893cc4aada17ffe /src
parent2658087f653657d2d23de2487e47963fe3dd40f9 (diff)
parent7f626e3b43cdfb6caa52929e479e9642004f7b77 (diff)
Fix the mStopTimeNs not be reset in Stopwatch#Restart am: 0c423089f7 am: 7f626e3b43
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/11931260 Change-Id: I80ebe27bcbcdfc51fc7ec910e48705e2ce5d4f5b
Diffstat (limited to 'src')
-rw-r--r--src/android/net/ip/IpClient.java8
-rw-r--r--src/android/net/util/Stopwatch.java3
2 files changed, 5 insertions, 6 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java
index eeff157..1591f43 100644
--- a/src/android/net/ip/IpClient.java
+++ b/src/android/net/ip/IpClient.java
@@ -819,11 +819,11 @@ public class IpClient extends StateMachine {
* Stop this IpClient.
*
* <p>This does not shut down the StateMachine itself, which is handled by {@link #shutdown()}.
+ * The message "arg1" parameter is used to record the disconnect code metrics.
+ * Usually this method is called by the peer (e.g. wifi) intentionally to stop IpClient,
+ * consider that's the normal user termination.
*/
public void stop() {
- // The message "arg1" parameter is used to record the disconnect code metrics.
- // Usually this method is called by the peer (e.g. wifi) intentionally to stop IpClient,
- // consider that's the normal user termination.
sendMessage(CMD_STOP, DisconnectCode.DC_NORMAL_TERMINATION.getNumber());
}
@@ -1079,8 +1079,6 @@ public class IpClient extends StateMachine {
}
// Record the DisconnectCode and transition to StoppingState.
- // When jumping to mStoppingState This function will ensure
- // that you will not forget to fill in DisconnectCode.
private void transitionToStoppingState(final DisconnectCode code) {
mIpProvisioningMetrics.setDisconnectCode(code);
transitionTo(mStoppingState);
diff --git a/src/android/net/util/Stopwatch.java b/src/android/net/util/Stopwatch.java
index 33653dd..88e523e 100644
--- a/src/android/net/util/Stopwatch.java
+++ b/src/android/net/util/Stopwatch.java
@@ -49,10 +49,11 @@ public class Stopwatch {
}
/**
- * Retart the Stopwatch.
+ * Restart the Stopwatch.
*/
public Stopwatch restart() {
mStartTimeNs = SystemClock.elapsedRealtimeNanos();
+ mStopTimeNs = 0;
return this;
}