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

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

Merge "Add flags to the API changes in AnimationUtils and Choreographer" into main

parents 32454d28 8eff9f67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3406,7 +3406,7 @@ package android.view {

  public final class Choreographer {
    method public static long getFrameDelay();
    method public long getFrameTimeNanos();
    method @FlaggedApi("android.view.flags.expected_presentation_time_api") public long getFrameTimeNanos();
    method public void postCallback(int, Runnable, Object);
    method public void postCallbackDelayed(int, Runnable, Object, long);
    method public void removeCallbacks(int, Runnable, Object);
@@ -3625,7 +3625,7 @@ package android.view.accessibility {
package android.view.animation {

  public class AnimationUtils {
    method public static void lockAnimationClock(long, long);
    method @FlaggedApi("android.view.flags.expected_presentation_time_api") public static void lockAnimationClock(long, long);
    method public static void unlockAnimationClock();
  }

+3 −0
Original line number Diff line number Diff line
@@ -16,9 +16,11 @@

package android.view;

import static android.view.flags.Flags.FLAG_EXPECTED_PRESENTATION_TIME_API;
import static android.view.DisplayEventReceiver.VSYNC_SOURCE_APP;
import static android.view.DisplayEventReceiver.VSYNC_SOURCE_SURFACE_FLINGER;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -695,6 +697,7 @@ public final class Choreographer {
     */
    @TestApi
    @UnsupportedAppUsage
    @FlaggedApi(FLAG_EXPECTED_PRESENTATION_TIME_API)
    public long getFrameTimeNanos() {
        synchronized (mLock) {
            if (!mCallbacksRunning) {
+4 −1
Original line number Diff line number Diff line
@@ -108,12 +108,15 @@ public class AnimationUtils {
     * @hide
     */
    @TestApi
    @FlaggedApi(FLAG_EXPECTED_PRESENTATION_TIME_API)
    public static void lockAnimationClock(long vsyncMillis, long expectedPresentationTimeNanos) {
        AnimationState state = sAnimationState.get();
        state.animationClockLocked = true;
        state.currentVsyncTimeMillis = vsyncMillis;
        if (!expectedPresentationTimeApi()) {
            state.mExpectedPresentationTimeNanos = expectedPresentationTimeNanos;
        }
    }

    /**
     * Frees the time lock set in place by {@link #lockAnimationClock(long)}. Must be called