Call Layer::getLayerDebugInfo from the main thread
Fixes an issue where drawing state could be accessed from a binder
thread. The function also mixed current state with drawing state
incorrectly. The function now only retrieves drawing state.
Bug: 150226608
Test: Steps in bug doesn't repro
Test: atest sffakehwc_test
Change-Id: I5537c53e8214e2785473839d71fd483d1a3219b6
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index dcc213f..9ce0fd4 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -1501,7 +1501,7 @@
LayerDebugInfo info;
const State& ds = getDrawingState();
info.mName = getName();
- sp<Layer> parent = getParent();
+ sp<Layer> parent = mDrawingParent.promote();
info.mParentName = parent ? parent->getName() : "none"s;
info.mType = getType();
info.mTransparentRegion = ds.activeTransparentRegion_legacy;