Merge "Make Pip usage of FrameCallbackScheduler an actual class"
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user