OSDN Git Service

Tightening up rotation behavior for PIP (2/3)
authorWinson Chung <winsonc@google.com>
Tue, 11 Apr 2017 18:19:23 +0000 (11:19 -0700)
committerWinson Chung <winsonc@google.com>
Fri, 14 Apr 2017 00:36:41 +0000 (17:36 -0700)
commit19953caad316a6afc6446bb268bdc062a3f5ab90
tree3546e0d4c15d5da34eb561f696e8a1cdf60d6b6c
parent3a68287c6cbb5327f824515fa128117300806fac
Tightening up rotation behavior for PIP (2/3)

- Change BoundsAnimationController to be more consistent:
  1) Ensure that on animation end is always called even when cancelled to
     ensure animation start/end parity in the callbacks
  2) Ensure that setPinnedStackSize() is only called between start/end
  3) Prevent calling setPinnedStackSize() to the final bounds if the
     animation is cancelled
- With that, we add a flag to cancel the current bounds animation when a
  rotation happens while the bounds are animating.  In addition, we also
  add a check from AM to WM before applying the resize during the animation
  in the case where WM sends the bounds to AM, but AM lock is held while
  updating the exact stack bounds (once that finishes the old stale bounds
  would have been applied)
- In addition, we can then move the handling of the of the rotation to the
  config change update in WM, if we handle it before the other checks.

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I62c6df8b349971cc82a7898ae8b26834723faec5
services/core/java/com/android/server/am/ActivityStackSupervisor.java
services/core/java/com/android/server/wm/BoundsAnimationController.java
services/core/java/com/android/server/wm/PinnedStackController.java
services/core/java/com/android/server/wm/PinnedStackWindowController.java
services/core/java/com/android/server/wm/TaskStack.java
services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java [new file with mode: 0644]