OSDN Git Service

Fix pinned stack destination been overwrite by obsolete animator.
authorwilsonshih <wilsonshih@google.com>
Wed, 3 Apr 2019 07:55:02 +0000 (15:55 +0800)
committerwilsonshih <wilsonshih@google.com>
Tue, 16 Apr 2019 06:34:20 +0000 (14:34 +0800)
commit4dd07128770768223b0025f4cdc7559cdc71707f
tree24bb8c62d2091f09a4044b10e8e7a9c0678541a3
parentbe0106abced580a34ea89d0484b2851d0b73065c
Fix pinned stack destination been overwrite by obsolete animator.

There is a race condition when an app leave from landscape mode and enter
pinned stack in portrait mode. First racer is that TaskStack will post
animateBounds to animation thread, the second is #onConfigurationChanged
will ask TaskStack to update new stack bounds if needed.

When the first animation executed, it will call TaskStack#onAnimationEnd
then #setPinnedStackSize, however, this bounds may already obsoleted if
configuration changed happen after first animation is posted.

To fix this issue, we can cancel the existing animator via verifying the
final destination, and prevent animator set obsoleted bounds back if the
animation is canceled.

Fix: 129723312
Test: Try reproduce this issue over 100+ times.
Test: atest ActivityManagerPinnedStackTests
Test: atest BoundsAnimationControllerTests

Change-Id: I5d42cbe576e7683b22679b1e97be07063c2a05d6
services/core/java/com/android/server/wm/BoundsAnimationController.java
services/core/java/com/android/server/wm/TaskStack.java