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

Commit 4badc8e7 authored by Jian-Syuan (Shane) Wong's avatar Jian-Syuan (Shane) Wong
Browse files

Add a getter method for expectedPresentationTimeMillis

Add a getter method for expectedPresentationTimeMillis so that the
expectPresentationTime can be obtained in milliseconds

Bug: 283122385
Test: atest ChoreographerTest
Change-Id: Id3b25bc2a45ac43c1b4667e92eab7076b70752d4
parent d6e28c1d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -738,6 +738,19 @@ public final class Choreographer {
        return mFrameData.getPreferredFrameTimeline().getExpectedPresentationTimeNanos();
    }


    /**
     * Same as {@link #getExpectedPresentationTimeNanos()} but with millisecond precision.
     *
     * @return The frame start time, in the {@link SystemClock#uptimeMillis()} time base.
     *
     * @throws IllegalStateException if no frame is in progress.
     * @hide
     */
    public long getExpectedPresentationTimeMillis() {
        return getExpectedPresentationTimeNanos() / TimeUtils.NANOS_PER_MS;
    }

    private void scheduleFrameLocked(long now) {
        if (!mFrameScheduled) {
            mFrameScheduled = true;