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

Commit 32fb6307 authored by John Reck's avatar John Reck
Browse files

Fix VPA.cancel()

 Bug: 15978905

 Need to make sure we re-sync the UI properties on animator cancel, also
 don't animate for 1 frame after cancel() is called

Change-Id: Ib660c0fb195b9f02bd795d03d43ea67bffebb499
parent 657bb845
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ bool BaseRenderNodeAnimator::animate(TreeInfo& info) {
    if (mPlayState < RUNNING) {
        return false;
    }
    if (mPlayState == FINISHED) {
        return true;
    }

    // If BaseRenderNodeAnimator is handling the delay (not typical), then
    // because the staging properties reflect the final value, we always need
@@ -209,6 +212,10 @@ void RenderPropertyAnimator::onAttached() {
void RenderPropertyAnimator::onStagingPlayStateChanged() {
    if (mStagingPlayState == RUNNING) {
        (mTarget->mutateStagingProperties().*mPropertyAccess->setter)(finalValue());
    } else if (mStagingPlayState == FINISHED) {
        // We're being canceled, so make sure that whatever values the UI thread
        // is observing for us is pushed over
        mTarget->setPropertyFieldsDirty(dirtyMask());
    }
}