Add a parent id to the offscreen layer parent proto
We parent all offscreen layers to a fake parent when we generate the proto dump. When generating
the fake parent proto, set a valid parent id of -1 so the flicker test tool does not fail.
Bug: 141326137
Test: flickertest passes
Test: generate winscope trace and check for offscreen layers
Change-Id: I29e0f7bdc736abd8cee58d9a47c08888adcb589d
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c01d3aa..0a14910 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -4335,6 +4335,7 @@
const int32_t offscreenRootLayerId = INT32_MAX - 2;
rootProto->set_id(offscreenRootLayerId);
rootProto->set_name("Offscreen Root");
+ rootProto->set_parent(-1);
for (Layer* offscreenLayer : mOffscreenLayers) {
// Add layer as child of the fake root