Merge "Ensure deferred cleanup when display is off" am: 5cc75e347f am: bd970d02bc am: 4d22ff3782

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1952223

Change-Id: If8a085c2e88386527044eeb0af9ac89fa09258d7
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 615af02..ce793ad 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2412,6 +2412,7 @@
     mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections);
 
     if (isDisplayConnected && !display->isPoweredOn()) {
+        getRenderEngine().cleanupPostRender();
         return;
     }