Merge "Fix bug incrementing log time"

This commit is contained in:
Soonil Nagarkar
2020-11-30 19:04:42 +00:00
committed by Android (Google) Code Review

View File

@@ -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++;