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/Layer.cpp b/services/surfaceflinger/Layer.cpp
index e7d2a11..c71379b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -150,7 +150,7 @@
mWindowType(static_cast<WindowInfo::Type>(
args.metadata.getInt32(gui::METADATA_WINDOW_TYPE, 0))),
mLayerCreationFlags(args.flags),
- mLegacyLayerFE(args.flinger->getFactory().createLayerFE(mName)) {
+ mLegacyLayerFE(args.flinger->getFactory().createLayerFE(mName, this)) {
ALOGV("Creating Layer %s", getDebugName());
uint32_t layerFlags = 0;
@@ -3982,7 +3982,7 @@
}
sp<LayerFE> Layer::copyCompositionEngineLayerFE() const {
- auto result = mFlinger->getFactory().createLayerFE(mName);
+ auto result = mFlinger->getFactory().createLayerFE(mName, this);
result->mSnapshot = std::make_unique<LayerSnapshot>(*mSnapshot);
return result;
}
@@ -3994,7 +3994,7 @@
return layerFE;
}
}
- auto layerFE = mFlinger->getFactory().createLayerFE(mName);
+ auto layerFE = mFlinger->getFactory().createLayerFE(mName, this);
mLayerFEs.emplace_back(path, layerFE);
return layerFE;
}