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

Commit 3a0ce754 authored by Issei Suzuki's avatar Issei Suzuki Committed by Automerger Merge Worker
Browse files

Merge "Add timestamp to ActivityOptions.OnAnimation*Listener" into tm-dev am:...

Merge "Add timestamp to ActivityOptions.OnAnimation*Listener" into tm-dev am: 408b90ff am: 69ca04c6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17860344



Change-Id: I2eee80f5c11f997b8071ac62bcb1afa939365251
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1e1eadd5 69ca04c6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -168,11 +168,11 @@ package android.app {
  }

  public static interface ActivityOptions.OnAnimationFinishedListener {
    method public void onAnimationFinished();
    method public void onAnimationFinished(long);
  }

  public static interface ActivityOptions.OnAnimationStartedListener {
    method public void onAnimationStarted();
    method public void onAnimationStarted(long);
  }

  public class ActivityTaskManager {
+15 −8
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.SystemClock;
import android.os.UserHandle;
import android.transition.TransitionManager;
import android.util.Pair;
@@ -634,9 +635,10 @@ public class ActivityOptions extends ComponentOptions {
            mAnimationStartedListener = new IRemoteCallback.Stub() {
                @Override
                public void sendResult(Bundle data) throws RemoteException {
                    final long elapsedRealtime = SystemClock.elapsedRealtime();
                    handler.post(new Runnable() {
                        @Override public void run() {
                            listener.onAnimationStarted();
                            listener.onAnimationStarted(elapsedRealtime);
                        }
                    });
                }
@@ -645,13 +647,15 @@ public class ActivityOptions extends ComponentOptions {
    }

    /**
     * Callback for use with {@link ActivityOptions#makeThumbnailScaleUpAnimation}
     * to find out when the given animation has started running.
     * Callback for finding out when the given animation has started running.
     * @hide
     */
    @TestApi
    public interface OnAnimationStartedListener {
        void onAnimationStarted();
        /**
         * @param elapsedRealTime {@link SystemClock#elapsedRealTime} when animation started.
         */
        void onAnimationStarted(long elapsedRealTime);
    }

    private void setOnAnimationFinishedListener(final Handler handler,
@@ -660,10 +664,11 @@ public class ActivityOptions extends ComponentOptions {
            mAnimationFinishedListener = new IRemoteCallback.Stub() {
                @Override
                public void sendResult(Bundle data) throws RemoteException {
                    final long elapsedRealtime = SystemClock.elapsedRealtime();
                    handler.post(new Runnable() {
                        @Override
                        public void run() {
                            listener.onAnimationFinished();
                            listener.onAnimationFinished(elapsedRealtime);
                        }
                    });
                }
@@ -672,13 +677,15 @@ public class ActivityOptions extends ComponentOptions {
    }

    /**
     * Callback for use with {@link ActivityOptions#makeThumbnailAspectScaleDownAnimation}
     * to find out when the given animation has drawn its last frame.
     * Callback for finding out when the given animation has drawn its last frame.
     * @hide
     */
    @TestApi
    public interface OnAnimationFinishedListener {
        void onAnimationFinished();
        /**
         * @param elapsedRealTime {@link SystemClock#elapsedRealTime} when animation finished.
         */
        void onAnimationFinished(long elapsedRealTime);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class RecentsTransition {
            private boolean mHandled;

            @Override
            public void onAnimationStarted() {
            public void onAnimationStarted(long elapsedRealTime) {
                // OnAnimationStartedListener can be called numerous times, so debounce here to
                // prevent multiple callbacks
                if (mHandled) {
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public abstract class ActivityOptionsCompat {
                callbackHandler,
                new ActivityOptions.OnAnimationStartedListener() {
                    @Override
                    public void onAnimationStarted() {
                    public void onAnimationStarted(long elapsedRealTime) {
                        if (callback != null) {
                            callbackHandler.post(callback);
                        }