Fix "Abnormal while playing netflix in PIP mode"

protected buffer usage of output buffer of framebuffer is determined by
if any input layer contains protected buffer.

If all the protected layers are handled by HWC,then GPU will process
normal layers only. It means, GPU got normal buffer as input but need
output to protected buffer.It would be memory violation for ARM as it
required at least one normal buffer as input for such case

Cherry-picked from AOSP. Conflicts in the test file are uninteresting;
both branches simply added new tests.
- services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp

Put the behavior change behind a flag.

Bug: 307674749
Test: atest
    libcompositionengine_test:OutputUpdateProtectedContentStateTest

Change-Id: I11d7c73c8eee4a46383516e8eb672827b26314e6
diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp
index f7adc0e..b7f06a9 100644
--- a/services/surfaceflinger/common/FlagManager.cpp
+++ b/services/surfaceflinger/common/FlagManager.cpp
@@ -131,6 +131,7 @@
     DUMP_READ_ONLY_FLAG(renderable_buffer_usage);
     DUMP_READ_ONLY_FLAG(restore_blur_step);
     DUMP_READ_ONLY_FLAG(dont_skip_on_early_ro);
+    DUMP_READ_ONLY_FLAG(protected_if_client);
 #undef DUMP_READ_ONLY_FLAG
 #undef DUMP_SERVER_FLAG
 #undef DUMP_FLAG_INTERVAL
@@ -210,6 +211,7 @@
 FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "")
 FLAG_MANAGER_READ_ONLY_FLAG(restore_blur_step, "debug.renderengine.restore_blur_step")
 FLAG_MANAGER_READ_ONLY_FLAG(dont_skip_on_early_ro, "")
+FLAG_MANAGER_READ_ONLY_FLAG(protected_if_client, "")
 
 /// Trunk stable server flags ///
 FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")