OSDN Git Service

Don't destroy surfaces of activities launched behind early.
authorWale Ogunwale <ogunwale@google.com>
Fri, 5 Dec 2014 17:03:48 +0000 (09:03 -0800)
committerWale Ogunwale <ogunwale@google.com>
Fri, 5 Dec 2014 22:52:04 +0000 (14:52 -0800)
When the launch activity behind feature was introduced in
http://ag/502868, we destroy the surfaces of windows associated with
the activity early in the last app window animation step. The causes
issues with activities that might be using the surface and not
prepared to have the surface destroyed from underneath them. We now
let the surface destruction get handled like any other window so all
the components/processes interested in the surface can be in the
right state when the surface is destroyed.

Bug: 18325222
Change-Id: I45e834a07a199b8a9e364f7392db99c871a43280

services/core/java/com/android/server/wm/AppWindowAnimator.java

index bf96ea5..5c81126 100644 (file)
@@ -308,13 +308,9 @@ public class AppWindowAnimator {
 
         transformation.clear();
 
-        final int N = mAllAppWinAnimators.size();
-        for (int i=0; i<N; i++) {
-            final WindowStateAnimator winAnim = mAllAppWinAnimators.get(i);
-            if (mAppToken.mLaunchTaskBehind) {
-                winAnim.mWin.mExiting = true;
-            }
-            winAnim.finishExit();
+        final int numAllAppWinAnimators = mAllAppWinAnimators.size();
+        for (int i = 0; i < numAllAppWinAnimators; i++) {
+            mAllAppWinAnimators.get(i).finishExit();
         }
         if (mAppToken.mLaunchTaskBehind) {
             try {