OSDN Git Service

When closing task stack remove reference to display content.
authorFilip Gruszczynski <gruszczy@google.com>
Mon, 10 Aug 2015 18:02:53 +0000 (11:02 -0700)
committerFilip Gruszczynski <gruszczy@google.com>
Mon, 10 Aug 2015 20:03:46 +0000 (13:03 -0700)
This tightens the guarantee that detached stack won't be used. We also
add logging to detecting a situation where a stack not belonging to a
display is being moved on that display.

Bug: 22191609
Change-Id: Ia674bb5960018104a56c5138775ab5216906675b

services/core/java/com/android/server/wm/DisplayContent.java
services/core/java/com/android/server/wm/TaskStack.java

index 5d6df26..4db0b1e 100644 (file)
@@ -203,7 +203,9 @@ class DisplayContent {
     }
 
     void moveStack(TaskStack stack, boolean toTop) {
-        mStacks.remove(stack);
+        if (!mStacks.remove(stack)) {
+            Slog.wtf(TAG, "moving stack that was not added: " + stack, new Throwable());
+        }
         mStacks.add(toTop ? mStacks.size() : 0, stack);
     }
 
index 4545032..794b49c 100644 (file)
@@ -385,8 +385,6 @@ public class TaskStack {
         }
 
         close();
-
-        mDisplayContent = null;
     }
 
     void resetAnimationBackgroundAnimator() {
@@ -518,6 +516,7 @@ public class TaskStack {
             mDimLayer.destroySurface();
             mDimLayer = null;
         }
+        mDisplayContent = null;
     }
 
     public void dump(String prefix, PrintWriter pw) {