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

Commit f3808afe authored by Chet Haase's avatar Chet Haase
Browse files

Handle AnimatorSet durations > MAXINT

It is possible to create an AnimatorSet with child animators
that have durations (including repeatCounts) totalling more
than MAXINT. This causes a long->int cast to fail and
starting that set to fail due to bad sorting logic.

One-liner fix to avoid auto-casting in this case.

Bug: 265674577
Test: CtsAnimatorSetTests pass, including new test
Change-Id: Ia8511f876674965e230f5f50728018b835815904
parent d572ae7f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1691,7 +1691,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
                    return 1;
                }
                // When neither event happens at INFINITE time:
                return (int) (t1 - t2);
                return t1 - t2 > 0 ? 1 : -1;
            }
        });