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

Commit dafc44ea authored by Hugo Benichi's avatar Hugo Benichi Committed by Lorenzo Colitti
Browse files

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 305af8e9)

Change-Id: If19011fc0c905948f2e42b975cfcc5f8672a95fb
parent 94dcb3c3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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 {