Fix negative frame time nanos.

On scheduling delays, frame time nanos changes.

Bug: 215299245
Bug: 198191703
Test: atest ChoreographerTest
Change-Id: Ia813971380276a93e0feabc3705dbe7515cc24ae
This commit is contained in:
Rachel Lee
2022-01-19 15:33:47 -08:00
parent 9162499ba8
commit cc9c644106

View File

@@ -779,7 +779,7 @@ public final class Choreographer {
+ "time to " + (lastFrameOffset * 0.000001f) + " ms in the past.");
}
frameTimeNanos = startNanos - lastFrameOffset;
frameData.setFrameTimeNanos(-lastFrameOffset);
frameData.setFrameTimeNanos(frameTimeNanos);
}
if (frameTimeNanos < mLastFrameTimeNanos) {