DO NOT MERGE: ApfFilter: use elapsedRealTime for RA lifetime
This patch replaces System.currentTimeMillis() with
SystemClock.elapsedRealTime() to make RA lifetime computation more
resilient to various external events inducing jumps in
currentTimeMillis().
Test: ApfTest passes.
(cherry picked from commit 305af8e98a)
Change-Id: If19011fc0c905948f2e42b975cfcc5f8672a95fb
This commit is contained in:
committed by
Lorenzo Colitti
parent
94dcb3c3fd
commit
dafc44ea11
@@ -283,10 +283,9 @@ public class ApfFilter {
|
||||
mReceiveThread.start();
|
||||
}
|
||||
|
||||
// Returns seconds since Unix Epoch.
|
||||
// TODO: use SystemClock.elapsedRealtime() instead
|
||||
// Returns seconds since device boot.
|
||||
private static long curTime() {
|
||||
return System.currentTimeMillis() / DateUtils.SECOND_IN_MILLIS;
|
||||
return SystemClock.elapsedRealtime() / DateUtils.SECOND_IN_MILLIS;
|
||||
}
|
||||
|
||||
public static class InvalidRaException extends Exception {
|
||||
|
||||
Reference in New Issue
Block a user