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

Commit be77616a authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Fix bug incrementing log time

Log start time was being incremented by the latest log event (being
added) instead of the first log event (being removed).

Test: manual
Change-Id: I4e15ba775d65d766ef0030d9cdfabe1f020185e6
parent 1681b437
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ public abstract class LocalEventLog {
    private long mLastLogRealtimeMs;

    public LocalEventLog(int size) {
        Preconditions.checkArgument(size > 0);
        mLog = new Log[size];
        mLogSize = 0;
        mLogEndIndex = 0;
@@ -163,7 +164,7 @@ public abstract class LocalEventLog {

        if (mLogSize == mLog.length) {
            // if log is full, size will remain the same, but update the start time
            mStartRealtimeMs += event.getTimeDeltaMs();
            mStartRealtimeMs += mLog[startIndex()].getTimeDeltaMs();
        } else {
            // otherwise add an item
            mLogSize++;