SurfaceFlinger: Fix reparenting following ReparentForDrawing
Counterintuitively, the new-parent doesn't have the children in
it's child list so even when cleaning up we need to call
reparentChildrenForDrawing on the old parent instead of the new parent.
Also clarify name to make this more obvious and add test.
Test: Transaction_test.cpp
Bug: 76099859
Change-Id: I935eec303dba320b5a2731606ec862311c5ca43e
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 996d686..15f4330 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -287,7 +287,7 @@
bool setOverrideScalingMode(int32_t overrideScalingMode);
void setInfo(uint32_t type, uint32_t appId);
bool reparentChildren(const sp<IBinder>& layer);
- void reparentChildrenForDrawing(const sp<Layer>& layer);
+ void setChildrenDrawingParent(const sp<Layer>& layer);
bool reparent(const sp<IBinder>& newParentHandle);
bool detachChildren();