[sf] use snapshots to update layer history

Avoid directly accessing layer drawing state from layer
history, instead provide a snapshot of the layer data
needed.

Test: atest android.graphics.cts.MatchContentFrameRateTest android.graphics.cts.SetFrameRateTest
Bug: 238781169
Change-Id: I120e89cca70beb9811a8ee9c5c3203f2a5cfabb4
diff --git a/services/surfaceflinger/FrontEnd/LayerLifecycleManager.cpp b/services/surfaceflinger/FrontEnd/LayerLifecycleManager.cpp
index 360a0a9..33cc429 100644
--- a/services/surfaceflinger/FrontEnd/LayerLifecycleManager.cpp
+++ b/services/surfaceflinger/FrontEnd/LayerLifecycleManager.cpp
@@ -187,6 +187,10 @@
                 continue;
             }
 
+            if (transaction.flags & ISurfaceComposer::eAnimation) {
+                layer->changes |= RequestedLayerState::Changes::Animation;
+            }
+
             uint32_t oldParentId = layer->parentId;
             uint32_t oldRelativeParentId = layer->relativeParentId;
             uint32_t oldTouchCropId = layer->touchCropId;