Plumb owner pid into Layer
For shared timeline visualization, the pid of the process owning the
layer is needed to show the information in the respective process
tracks. This change stores the newly added METADATA_OWNER_PID
information sent as a part of the Layer creation args
Bug: 170911969
Test: pid section of `adb shell dumpsys SurfaceFlinger --frametimeline -<all/jank>`
Change-Id: Ib1cd9b6239501b0b92283dca19d7de3916fff604
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 5cb56a5..b1ab9ec 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -855,6 +855,8 @@
uid_t getOwnerUid() { return mOwnerUid; }
+ pid_t getOwnerPid() { return mOwnerPid; }
+
// This layer is not a clone, but it's the parent to the cloned hierarchy. The
// variable mClonedChild represents the top layer that will be cloned so this
// layer will be the parent of mClonedChild.
@@ -1047,6 +1049,10 @@
// If created from a system process, the value can be passed in.
uid_t mOwnerUid;
+ // The owner pid of the layer. If created from a non system process, it will be the calling pid.
+ // If created from a system process, the value can be passed in.
+ pid_t mOwnerPid;
+
private:
virtual void setTransformHint(ui::Transform::RotationFlags) {}