SF: Fix a defect in the layer filtering logic

Change 32cbe2 broke the layer filtering logic when moving it over to
CompositionEngine. It would allow certain layers to appear on a virtual
display when they were supposed to be filtered out.

This corrects the logic to be what it was supposed to be, and adds a
unit test that verifies and documents the expected behavior.

Bug: 123248930
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Test: atest android.media.cts.EncodeVirtualDisplayWithCompositionTest

Change-Id: Id2c4b4d32da405c64533924027795620f2d6ee61
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputCompositionState.cpp b/services/surfaceflinger/CompositionEngine/src/OutputCompositionState.cpp
index 7d8765f..78807ff 100644
--- a/services/surfaceflinger/CompositionEngine/src/OutputCompositionState.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/OutputCompositionState.cpp
@@ -22,11 +22,9 @@
 void OutputCompositionState::dump(std::string& out) const {
     dumpVal(out, "isEnabled", isEnabled);
     dumpVal(out, "isSecure", isSecure);
-    if (singleLayerStack) {
-        out.append("layerStack=<any>");
-    } else {
-        dumpVal(out, "layerStack", singleLayerStackId);
-    }
+
+    dumpVal(out, "layerStack", layerStackId);
+    dumpVal(out, "layerStackInternal", layerStackInternal);
 
     out.append("\n   ");