[layertracegenerator] be more resilient to unknown layer ids

While unexpected, the layer lifecycle in legacy which is used to
generate the transaction traces is less explicit. We rely on layer
destruction when the object becomes unreachable. The new
front end logic will crash if called with an unknown layer id.
While we have to interop between both sets of logic, log and
ignore the unknown layer ids so we can still generate useful
layer traces.

Fixes: 275630566
Test: presbumit
Change-Id: I5b2a217c78b4a9e94f0772459d6aa0c68a8a51d0
diff --git a/services/surfaceflinger/Tracing/TransactionTracing.cpp b/services/surfaceflinger/Tracing/TransactionTracing.cpp
index 26ed878..87a633f 100644
--- a/services/surfaceflinger/Tracing/TransactionTracing.cpp
+++ b/services/surfaceflinger/Tracing/TransactionTracing.cpp
@@ -271,6 +271,7 @@
         for (const proto::LayerState& layerState : transaction.layer_changes()) {
             auto it = mStartingStates.find(layerState.layer_id());
             if (it == mStartingStates.end()) {
+                // TODO(b/238781169) make this log fatal when we switch over to using new fe
                 ALOGW("Could not find layer id %d", layerState.layer_id());
                 continue;
             }