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

Commit f1937d8e authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Make Pip usage of FrameCallbackScheduler an actual class"

parents 88a3239a c6c60307
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -83,8 +83,18 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,

    private ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal =
            ThreadLocal.withInitial(() -> {
                FrameCallbackScheduler scheduler = runnable ->
                final Looper initialLooper = Looper.myLooper();
                final FrameCallbackScheduler scheduler = new FrameCallbackScheduler() {
                    @Override
                    public void postFrameCallback(@androidx.annotation.NonNull Runnable runnable) {
                        Choreographer.getSfInstance().postFrameCallback(t -> runnable.run());
                    }

                    @Override
                    public boolean isCurrentThread() {
                        return Looper.myLooper() == initialLooper;
                    }
                };
                AnimationHandler handler = new AnimationHandler(scheduler);
                return handler;
            });