Move shared end pending anim logic for reusability
am: b0fcded7aa

Change-Id: Icce5133038bf2fbeec0eb78cd4f8478cc3faf447