SF: Fix duplicate callbacks from mirrored layers
When cloning layers, we would also clone the layer's
callback handles which resulted in SF emitting duplicate
callbacks.
Test: presubmit
Test: launcher does not ANR when switching wallpapers with screen recording enabled
Bug: 205922358
Change-Id: Ic0435164f27d9bca7f80fc57d9021a9f544c936f
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index b107f8e..c1af468 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -929,6 +929,7 @@
bool isClone() { return mClonedFrom != nullptr; }
bool isClonedFromAlive() { return getClonedFrom() != nullptr; }
+ void cloneDrawingState(const Layer* from);
void updateClonedDrawingState(std::map<sp<Layer>, sp<Layer>>& clonedLayersMap);
void updateClonedChildren(const sp<Layer>& mirrorRoot,
std::map<sp<Layer>, sp<Layer>>& clonedLayersMap);