OSDN Git Service

Clean-up WindowState if exit animation is done before app finishes
authorWale Ogunwale <ogunwale@google.com>
Fri, 19 Feb 2016 23:18:45 +0000 (15:18 -0800)
committerWale Ogunwale <ogunwale@google.com>
Fri, 19 Feb 2016 23:18:45 +0000 (15:18 -0800)
commitc48a354733ff150e4a07f6b0743009001aa4f48d
tree7a8d14d5371d4a0cd23742eb63239816ac47b652
parent31af215b26cc0832a35509668241f0f7c2496e3c
Clean-up WindowState if exit animation is done before app finishes

In ag/862571 we prevent window states from been removed before the
app is stopped since it can still be rendering to the surface.
The CL also left WindowState.mExiting as true after the exit
transition animation runs. This is okay if the app finishes before
the exit animation is done, but if the exit animation finishes before
the app finishes, then we will always think we need to run an exit
animation and not remove the windows when the app and later activity
manager tries to remove the windows.
mExiting is used to mean exiting animation is running, if it is set to
true then all the code assumes an exit animation is still running and
doesn't remove the window state.
- Always set mExiting when animation is done.
- Renamed mExiting to mAnimatingExit so it is more clear what it is used
for
- Allow window state to be removed is the current surface isn't shown.
This should be save since there won't be any visual effect to the user.
- Rename WindowState.mClientRemoveRequested to WindowState.mWindowRemovalAllowed
and move setting it to true into WMS.removeWindow() so it catches all cases.
- Cleaned-up the code some to be a little clearer.

Bug: 27112965
Change-Id: I6f03d3c75b5b7728e42ceadc8703df40a3b4ae63
services/core/java/com/android/server/wm/AppWindowToken.java
services/core/java/com/android/server/wm/TaskStack.java
services/core/java/com/android/server/wm/WindowManagerService.java
services/core/java/com/android/server/wm/WindowState.java
services/core/java/com/android/server/wm/WindowStateAnimator.java
services/core/java/com/android/server/wm/WindowSurfacePlacer.java