SF: Pass owning Layer when creating LayerFE
This is a quick patch for ARC so that the LayerFE's know what Layer they
correspond to. A recently reverted change to remove
legacyFrontEndEnabled broke ARC targets as the new code created
LayerFE's that didn't know the corresponding Layer, and caused other
startup failures as a result.
Bug: 337894453
Test: Play Store is usable on Chromebooks
Test: atest libsurfaceflinger_unittest
Change-Id: I0d83153236d99d65d850b1fb3fdd8d1cf461b50d
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index df226c9..6730ab0 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -9337,7 +9337,7 @@
"Couldnt find layer object for %s",
snapshot->getDebugString().c_str());
Layer* legacyLayer = (it == mLegacyLayers.end()) ? nullptr : it->second.get();
- sp<LayerFE> layerFE = getFactory().createLayerFE(snapshot->name);
+ sp<LayerFE> layerFE = getFactory().createLayerFE(snapshot->name, legacyLayer);
layerFE->mSnapshot = std::make_unique<frontend::LayerSnapshot>(*snapshot);
layers.emplace_back(legacyLayer, std::move(layerFE));
});