Fix Overview crash with 3 button navigation when animation is disabled
The OverviewCommandHelper conversion to kotlin introduced a bug when using 3-button-navigation to go to Overview when the animation is disabled. A NullPointerException happens in the AnimatorListenerAdapter implementation in OverviewCommandHelper when StateManager.goToState calls onAnimationEnd providing a null argument to a function that shouldn't allow a null value. The abstract class AnimatorListenerAdapter implements AnimatorListener functions containing @NonNull Animator. However, AnimatorListenerAdapter overrides the interface functions without adding a @NonNull annotation in the arguments. In Java, this is allowed, causing only a warning. In Kotlin, due to the null safety nature, the compiler forces a null check for nullable types and doesn't allow the implementation of a @NonNull argument to become nullable. To fix this issue we created a empty AnimatorSet to provide to onAnimationEnd instead of null. For more context when @NonNull was added: - The @NonNull annotation was added to fix b/206801689, however it was never updated for AnimatorListenerAdapterImproved Commit Message Fix: 364860731 Bug: 352046797 Flag: EXEMPT bugfix Test: Manual. Instructions in the bug. Change-Id: I120af3d75e614581d6ac0f867a8c6f9419ee1bd3
Loading
Please register or sign in to comment