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

Commit a5482d7e authored by Rachel Lee's avatar Rachel Lee Committed by Cherrypicker Worker
Browse files

Fix frame timelines length on USE_VSYNC = false

Bug: 285093700
Test: atest ChoreographerTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:88df4a859a82b36275de8fbb7d701a870f34db1e)
Merged-In: I111dc61c67335ffc46da5bed7c187bc4ad615d4a
Change-Id: I111dc61c67335ffc46da5bed7c187bc4ad615d4a
parent 9a3027b9
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1167,10 +1167,9 @@ public final class Choreographer {
         */
        FrameTimeline update(
                long frameTimeNanos, DisplayEventReceiver.VsyncEventData vsyncEventData) {
            if (vsyncEventData.frameTimelinesLength == 0) {
                throw new IllegalArgumentException(
                        "Vsync event timelines length must be greater than 0");
            }
            // Even if the frame timelines length is 0, continue with allocation for API
            // FrameData.getFrameTimelines consistency. The 0 length frame timelines code path
            // should only occur when USE_VSYNC property is false.
            if (mFrameTimelines.length != vsyncEventData.frameTimelinesLength) {
                allocateFrameTimelines(vsyncEventData.frameTimelinesLength);
            }