summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 83ab5cfce2..414c8dd23d 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -1205,6 +1205,14 @@ bool Layer::isHiddenByPolicy() const {
if (parent != nullptr && parent->isHiddenByPolicy()) {
return true;
}
+ if (usingRelativeZ(LayerVector::StateSet::Drawing)) {
+ auto zOrderRelativeOf = mDrawingState.zOrderRelativeOf.promote();
+ if (zOrderRelativeOf != nullptr) {
+ if (zOrderRelativeOf->isHiddenByPolicy()) {
+ return true;
+ }
+ }
+ }
return s.flags & layer_state_t::eLayerHidden;
}
@@ -1586,7 +1594,7 @@ int32_t Layer::getZ() const {
return mDrawingState.z;
}
-bool Layer::usingRelativeZ(LayerVector::StateSet stateSet) {
+bool Layer::usingRelativeZ(LayerVector::StateSet stateSet) const {
const bool useDrawing = stateSet == LayerVector::StateSet::Drawing;
const State& state = useDrawing ? mDrawingState : mCurrentState;
return state.zOrderRelativeOf != nullptr;