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

Commit 4c0b7cc7 authored by Hugo Benichi's avatar Hugo Benichi
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: Idbde700025fecfecefb8162d66b94194a87829d5
parent c8183749
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -285,10 +285,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 {