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

Commit 54cd52b5 authored by Jian-Syuan (Shane) Wong's avatar Jian-Syuan (Shane) Wong Committed by Android (Google) Code Review
Browse files

Merge "Add a getter method for expectedPresentationTimeMillis"

parents 0b179b02 4badc8e7
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;