Dynamically disable blurs when tunnel mode is used

Tunnel mode allows applications to stream video content directly to the
hardware composer, bypassing surface flinger. This is done for
performance.

Since the content bypasses surface flinger, the respective layer is empty.
So when we try to compute a blur on top of such a layer, the output is
a black surface. To avoid this empty surface, we want to make
surfaceflinger disable blurs whenever there is a layer that has tunnel
mode.

When tunnel mode is used, the respective layer is given a handle to a
sideband stream, which is how surface flinger recognises that tunnel
mode is in use.

This CL adds logic to compute when there is a sideband stream in one of
the layers in composition engine and then instructs
Layer::prepareClientComposition to not set backgroundBlurRadius or
blurRegions.

Bug: 171457637
Test: m && flash && check that requesting blur on top of a tunnel mode
layer does not make the screen black

Change-Id: I40a206f6ad4e805c66756317cbea1cf69db32dfc
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index ab0d3df..90396dd 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -627,7 +627,7 @@
 // ---------------------------------------------------------------------------
 
 std::optional<compositionengine::LayerFE::LayerSettings> Layer::prepareClientComposition(
-        compositionengine::LayerFE::ClientCompositionTargetSettings& /* targetSettings */) {
+        compositionengine::LayerFE::ClientCompositionTargetSettings& targetSettings) {
     if (!getCompositionState()) {
         return {};
     }
@@ -649,8 +649,10 @@
 
     layerSettings.alpha = alpha;
     layerSettings.sourceDataspace = getDataSpace();
-    layerSettings.backgroundBlurRadius = getBackgroundBlurRadius();
-    layerSettings.blurRegions = getBlurRegions();
+    if (!targetSettings.disableBlurs) {
+        layerSettings.backgroundBlurRadius = getBackgroundBlurRadius();
+        layerSettings.blurRegions = getBlurRegions();
+    }
     return layerSettings;
 }