SF: Allow privileged clients to create layers offscreen

If the caller is privileged and a new layer has a null parent,
the new layer will be added to root. When recreating layer
state, we create layers as a privileged client so we need to
specify if a layer need to be added offscreen.

Test: presubmit
Bug: 200284593
Change-Id: If07953b401020b115b0e364ff03ac65503bdc0ed
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 4cdd8fa..0f72a46 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -98,6 +98,7 @@
     uid_t callingUid;
     uint32_t textureName;
     std::optional<uint32_t> sequence = std::nullopt;
+    bool addToRoot = true;
 };
 
 class Layer : public virtual RefBase, compositionengine::LayerFE {