Loading services/core/java/com/android/server/wm/WindowAnimator.java +24 −7 Original line number Diff line number Diff line Loading @@ -87,8 +87,18 @@ public class WindowAnimator { private final SurfaceFlingerVsyncChoreographer mSfChoreographer; private Choreographer mChoreographer; private boolean mAnimationScheduled; /** * Indicates whether we have an animation frame callback scheduled, which will happen at * vsync-app and then schedule the animation tick at the right time (vsync-sf). */ private boolean mAnimationFrameCallbackScheduled; /** * Indicates whether we have an animation tick scheduled. The tick is the thing that actually * executes the animation step, which will happen at vsync-sf. */ private boolean mAnimationTickScheduled; WindowAnimator(final WindowManagerService service) { mService = service; Loading @@ -104,13 +114,20 @@ public class WindowAnimator { mService.getDefaultDisplayContentLocked().getDisplay(), mChoreographer); mAnimationTick = () -> { synchronized (mService.mWindowMap) { mAnimationScheduled = false; mAnimationTickScheduled = false; animateLocked(mCurrentFrameTime); } }; mAnimationFrameCallback = frameTimeNs -> { synchronized (mService.mWindowMap) { mCurrentFrameTime = frameTimeNs; mAnimationFrameCallbackScheduled = false; if (mAnimationTickScheduled) { return; } mAnimationTickScheduled = true; mSfChoreographer.scheduleAtSfVsync(mAnimationTick); } }; } Loading Loading @@ -371,8 +388,8 @@ public class WindowAnimator { } void scheduleAnimation() { if (!mAnimationScheduled) { mAnimationScheduled = true; if (!mAnimationFrameCallbackScheduled) { mAnimationFrameCallbackScheduled = true; mChoreographer.postFrameCallback(mAnimationFrameCallback); } } Loading @@ -386,7 +403,7 @@ public class WindowAnimator { } boolean isAnimationScheduled() { return mAnimationScheduled; return mAnimationFrameCallbackScheduled || mAnimationTickScheduled; } Choreographer getChoreographer() { Loading Loading
services/core/java/com/android/server/wm/WindowAnimator.java +24 −7 Original line number Diff line number Diff line Loading @@ -87,8 +87,18 @@ public class WindowAnimator { private final SurfaceFlingerVsyncChoreographer mSfChoreographer; private Choreographer mChoreographer; private boolean mAnimationScheduled; /** * Indicates whether we have an animation frame callback scheduled, which will happen at * vsync-app and then schedule the animation tick at the right time (vsync-sf). */ private boolean mAnimationFrameCallbackScheduled; /** * Indicates whether we have an animation tick scheduled. The tick is the thing that actually * executes the animation step, which will happen at vsync-sf. */ private boolean mAnimationTickScheduled; WindowAnimator(final WindowManagerService service) { mService = service; Loading @@ -104,13 +114,20 @@ public class WindowAnimator { mService.getDefaultDisplayContentLocked().getDisplay(), mChoreographer); mAnimationTick = () -> { synchronized (mService.mWindowMap) { mAnimationScheduled = false; mAnimationTickScheduled = false; animateLocked(mCurrentFrameTime); } }; mAnimationFrameCallback = frameTimeNs -> { synchronized (mService.mWindowMap) { mCurrentFrameTime = frameTimeNs; mAnimationFrameCallbackScheduled = false; if (mAnimationTickScheduled) { return; } mAnimationTickScheduled = true; mSfChoreographer.scheduleAtSfVsync(mAnimationTick); } }; } Loading Loading @@ -371,8 +388,8 @@ public class WindowAnimator { } void scheduleAnimation() { if (!mAnimationScheduled) { mAnimationScheduled = true; if (!mAnimationFrameCallbackScheduled) { mAnimationFrameCallbackScheduled = true; mChoreographer.postFrameCallback(mAnimationFrameCallback); } } Loading @@ -386,7 +403,7 @@ public class WindowAnimator { } boolean isAnimationScheduled() { return mAnimationScheduled; return mAnimationFrameCallbackScheduled || mAnimationTickScheduled; } Choreographer getChoreographer() { Loading