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

Commit ef7b9c7e authored by Mathias Agopian's avatar Mathias Agopian
Browse files

screenshots could stop working after camera was used

once a secure window is put on screen the display
would retain its "secure" flag forever, preventing
screenshots from being taken.

Bug: 6933967
Change-Id: I5be8355145ca7d580d84552311642f8fa912fe6a
parent 748f3df6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ void DisplayDevice::makeCurrent(const sp<const DisplayDevice>& hw, EGLContext ct

void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {
    mVisibleLayersSortedByZ = layers;
    mSecureLayerVisible = false;
    size_t count = layers.size();
    for (size_t i=0 ; i<count ; i++) {
        if (layers[i]->isSecure()) {
+6 −3
Original line number Diff line number Diff line
@@ -2095,6 +2095,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,

    // only one display supported for now
    if (CC_UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT)) {
        ALOGE("invalid display %d", dpy);
        return BAD_VALUE;
    }

@@ -2109,10 +2110,12 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,

    // if we have secure windows on this display, never allow the screen capture
    if (hw->getSecureLayerVisible()) {
        ALOGW("FB is protected: PERMISSION_DENIED");
        return PERMISSION_DENIED;
    }

    if ((sw > hw_w) || (sh > hw_h)) {
        ALOGE("size mismatch (%d, %d) > (%d, %d)", sw, sh, hw_w, hw_h);
        return BAD_VALUE;
    }