From b123f47bbde4d30be44ca02fc369f6ff83dbff8f Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Mon, 22 Jun 2020 11:52:39 -0700 Subject: 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 Merged-In: I5537c53e8214e2785473839d71fd483d1a3219b6 Change-Id: I04daedcb9a890083cc710bab30b295e14b9872ae --- services/surfaceflinger/Layer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/surfaceflinger/Layer.cpp') diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 1318bc0b2a..fccaf8166d 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1280,7 +1280,7 @@ LayerDebugInfo Layer::getLayerDebugInfo() const { LayerDebugInfo info; const State& ds = getDrawingState(); info.mName = getName(); - sp parent = getParent(); + sp parent = mDrawingParent.promote(); info.mParentName = (parent == nullptr ? std::string("none") : parent->getName().string()); info.mType = std::string(getTypeId()); info.mTransparentRegion = ds.activeTransparentRegion_legacy; -- cgit v1.2.3-59-g8ed1b