hwc2: Do not flush on empty layer stack.
-- Some applications can take time to queue buffers during switches ie;
HDR to Non-HDR, Secure to Non-secure etc; Even though layer stack
is empty it is OK to display previous frame.
-- Composer Client explicitly clears layers upon SurfaceFlinger death.
Since client isn't active, chances of getting a new frame is very unlikey.
Trigger flush so that content gets cleared.
Change-Id: If91135b3d5ea6d0f8842c7ef75547a68002c70ff
CRs-Fixed: 2489780
diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp
index b4c2290..63bd2d8 100644
--- a/composer/hwc_display_builtin.cpp
+++ b/composer/hwc_display_builtin.cpp
@@ -203,7 +203,7 @@
if (layer_set_.empty()) {
// Avoid flush for Command mode panel.
- flush_ = !IsDisplayCommandMode();
+ flush_ = !client_connected_;
validated_ = true;
return status;
}