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

Commit ae8460cf authored by Rachel Lee's avatar Rachel Lee Committed by Automerger Merge Worker
Browse files

Merge "Minimum 1 frame timeline in java Choreographer" into udc-qpr-dev am: ddb2fb71

parents d344ecee ddb2fb71
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -1155,11 +1155,17 @@ public final class Choreographer {
        }

        private void allocateFrameTimelines(int length) {
            // Maintain one default frame timeline for API (such as getFrameTimelines and
            // getPreferredFrameTimeline) consistency. It should have default data when accessed.
            length = Math.max(1, length);

            if (mFrameTimelines == null || mFrameTimelines.length != length) {
                mFrameTimelines = new FrameTimeline[length];
                for (int i = 0; i < mFrameTimelines.length; i++) {
                    mFrameTimelines[i] = new FrameTimeline();
                }
            }
        }

        /**
         * Update the frame data with a {@code DisplayEventReceiver.VsyncEventData} received from
@@ -1167,12 +1173,7 @@ public final class Choreographer {
         */
        FrameTimeline update(
                long frameTimeNanos, DisplayEventReceiver.VsyncEventData vsyncEventData) {
            // 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);
            }
            mFrameTimeNanos = frameTimeNanos;
            mPreferredFrameTimelineIndex = vsyncEventData.preferredFrameTimelineIndex;
            for (int i = 0; i < mFrameTimelines.length; i++) {