[sf] Use layer id as snapshot ids
Flicker tests rely on layer ids for some assertions. So when possible
use the layer id for the snapshot used to generate layer traces.
Also keep track of the order in which layers are added so its easier to
write tests.
Test: atest FlickerTests w/new fe
Bug: 238781169
Change-Id: Ie0f93ca956e6d043c9d95d00bc205d242e47c4cc
diff --git a/services/surfaceflinger/FrontEnd/LayerLifecycleManager.h b/services/surfaceflinger/FrontEnd/LayerLifecycleManager.h
index f258678..f0d2c22 100644
--- a/services/surfaceflinger/FrontEnd/LayerLifecycleManager.h
+++ b/services/surfaceflinger/FrontEnd/LayerLifecycleManager.h
@@ -108,6 +108,9 @@
std::vector<std::unique_ptr<RequestedLayerState>> mLayers;
// Layers pending destruction. Layers will be destroyed once changes are committed.
std::vector<std::unique_ptr<RequestedLayerState>> mDestroyedLayers;
+ // Keeps track of all the layers that were added in order. Changes will be cleared once
+ // committed.
+ std::vector<RequestedLayerState*> mAddedLayers;
};
} // namespace android::surfaceflinger::frontend