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

Skip to content
Commit 64ad4e34 authored by Jordan Silva's avatar Jordan Silva
Browse files

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
parent 64832004
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment