Merge "Adds DESTROY_CONTENT_ON_REMOVAL to VirtualDisplay flags"
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java
index 2c435a2..680fed8 100644
--- a/core/java/android/app/ActivityView.java
+++ b/core/java/android/app/ActivityView.java
@@ -361,7 +361,8 @@
DISPLAY_NAME + "@" + System.identityHashCode(this),
width, height, getBaseDisplayDensity(), mTmpSurface,
DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC
- | DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY);
+ | DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
+ | DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL);
if (mVirtualDisplay == null) {
Log.e(TAG, "Failed to initialize ActivityView");
return;