Cancel existing insets animation if the side is changed

If the side of an insets source is changed, the coordinates will be
stale and cannot be trusted. This CL fast-forward the animation to the
end state by cancelling it.

This CL also:
- restores the logic about setting mHasPendingPosition which was removed
  accidentally in commit: ac6cde62e08f5fe42cabc048ed985537d80d1d6b,
- refines the logic about deciding the visible state of the animation,
  and
- fixes potential leaks of insets hints when mHasPendingPosition.

Fix: 322448072
Fix: 349901745
Flag: EXEMPT bugfix
Test: atest InsetsAnimationControlImplTest InsetsSourceConsumerTest
Change-Id: Ic83ab109ea4d486583d75b578cefad16df678666
7 files changed