OSDN Git Service

Add animation to running animation list before starting.
authorchaviw <chaviw@google.com>
Fri, 25 May 2018 23:18:42 +0000 (16:18 -0700)
committerchaviw <chaviw@google.com>
Fri, 25 May 2018 23:34:58 +0000 (16:34 -0700)
commitc5eb816f92e81e617cb03d4cdb3805ee084662bd
tree548b85a584b643704b3ab51af7b49f1525a164a9
parentccf93b279212e10a14dc2ff5e3c35826d73739c4
Add animation to running animation list before starting.

The animation needs to be added to the animation list before starting
to ensure it's in the list before onAnimationEnd is called. Specifically,
this can happen if the duration is 0 since the animation will complete
very quickly. If that occurs, the animation will be added to the list
after it's been "removed" which means there will continue to be a reference
to that animation even after it's completed.

Also fix a few other issues:
1. Don't create a dim layer if stopDim is called. This causes excess
layers to be created, just so they can be destroyed.
2. Add try/catch to dim layer create so the system doesn't crash if the
layer fails to create.

Test: Enter split screen and move divider so dim layers are show and
hidden. There are no longer excess dim layers being created and leashes
are being properly dereferenced.
Fixes: 80206408

Change-Id: I7198bd5e972fce32633869697a4d26f51e675d48
services/core/java/com/android/server/wm/Dimmer.java
services/core/java/com/android/server/wm/SurfaceAnimationRunner.java