surfaceflinger: buffer was released early for clear client target requests [1/1]

PD#SWPL-76998
BUG=227223204

Problem:
buffer was released early when layer is not marked
as CLIENT composition and requests clear client target.

Solution:
do not early release the buffer when layer is not
marked as CLIENT composition.

Verify:
adt3

Change-Id: I1f6c9be0d4f2e2a3f10ab6bcd64a08d9322a71a3
Signed-off-by: Tianhua Sun <tianhua.sun@amlogic.com>
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index 2d2b3df..aac478d 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -1365,7 +1365,10 @@
                 }
             }
 
-            outLayerFEs.push_back(&layerFE);
+            if (clientComposition) {
+                outLayerFEs.push_back(&layerFE);
+            }
+
             clientCompositionLayers.insert(clientCompositionLayers.end(),
                                            std::make_move_iterator(results.begin()),
                                            std::make_move_iterator(results.end()));