SF: Carve out LayerCreationArgs

Move most layer creation logic outside of Layer.

Specify layer sequence id via creation args
and move ownerUid/ownerPid into the layer
creation args so we can share logic between
the existing layer class and the new server
layer state.

Add layer parent and mirror from handles
to be used with the new LayerLifecycleManager.

Bug: 238781169
Test: presubmit

Change-Id: I7cf344181b29f405c070cda2ad45f06233fd1e8c
diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp
index 30b8759..7202bef 100644
--- a/services/surfaceflinger/Client.cpp
+++ b/services/surfaceflinger/Client.cpp
@@ -24,6 +24,7 @@
 #include <gui/AidlStatusUtil.h>
 
 #include "Client.h"
+#include "FrontEnd/LayerCreationArgs.h"
 #include "Layer.h"
 #include "SurfaceFlinger.h"
 
@@ -83,7 +84,8 @@
     sp<IBinder> handle;
     LayerCreationArgs args(mFlinger.get(), sp<Client>::fromExisting(this), name.c_str(),
                            static_cast<uint32_t>(flags), std::move(metadata));
-    const status_t status = mFlinger->createLayer(args, parent, *outResult);
+    args.parentHandle = parent;
+    const status_t status = mFlinger->createLayer(args, *outResult);
     return binderStatusFromStatusT(status);
 }