Merge "Avoid bad animation states." into rvc-dev am: 5bef1eb6da

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11854105

Change-Id: Ice2eed19b2aaca71c4b369ab4699126b509dcb98