Make Pip usage of FrameCallbackScheduler an actual class
Bug: 175330528 Test: Builds with new dynamic-animation library Change-Id: I1632bd87a0f02940317a38a87b074d303f80b8c7
This commit is contained in:
@@ -83,8 +83,18 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
|
|||||||
|
|
||||||
private ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal =
|
private ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal =
|
||||||
ThreadLocal.withInitial(() -> {
|
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());
|
Choreographer.getSfInstance().postFrameCallback(t -> runnable.run());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCurrentThread() {
|
||||||
|
return Looper.myLooper() == initialLooper;
|
||||||
|
}
|
||||||
|
};
|
||||||
AnimationHandler handler = new AnimationHandler(scheduler);
|
AnimationHandler handler = new AnimationHandler(scheduler);
|
||||||
return handler;
|
return handler;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user