Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc0b9110 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

libsurfaceflinger: fix screenshot permission check

Fix the logic for layers we check isSecure or isVisible for.  It was
regressed by my previous change to support
WINDOW_TYPE_DONT_SCREENSHOT.

Bug: 63311708
Bug: 62656774
Test: CTS
Change-Id: I7768cb590014cc610ec564847958bbd98742c277
parent 8f09b6ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4392,7 +4392,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(const sp<const DisplayDevice>&
    bool secureLayerIsVisible = false;
    for (const auto& layer : mDrawingState.layersSortedByZ) {
        const Layer::State& state(layer->getDrawingState());
        if (layer->belongsToDisplay(hw->getLayerStack(), false) ||
        if (!layer->belongsToDisplay(hw->getLayerStack(), false) ||
                (state.z < minLayerZ || state.z > maxLayerZ)) {
            continue;
        }