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

Commit bbdb3060 authored by Melody Hsu's avatar Melody Hsu Committed by Android (Google) Code Review
Browse files

Merge "Scope locks for mirrorDisplay" into main

parents c4aacbb9 2896e20e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -5572,6 +5572,7 @@ status_t SurfaceFlinger::mirrorDisplay(DisplayId displayId, const LayerCreationA
    ui::LayerStack layerStack;
    sp<Layer> rootMirrorLayer;
    status_t result = 0;
    LayerCreationArgs mirrorArgs = LayerCreationArgs::fromOtherArgs(args);

    {
        Mutex::Autolock lock(mStateLock);
@@ -5582,7 +5583,6 @@ status_t SurfaceFlinger::mirrorDisplay(DisplayId displayId, const LayerCreationA
        }

        layerStack = display->getLayerStack();
        LayerCreationArgs mirrorArgs = LayerCreationArgs::fromOtherArgs(args);
        mirrorArgs.flags |= ISurfaceComposerClient::eNoColorFill;
        mirrorArgs.addToRoot = true;
        mirrorArgs.layerStackToMirror = layerStack;
@@ -5590,11 +5590,11 @@ status_t SurfaceFlinger::mirrorDisplay(DisplayId displayId, const LayerCreationA
        if (result != NO_ERROR) {
            return result;
        }
    }
    outResult.layerId = rootMirrorLayer->sequence;
    outResult.layerName = String16(rootMirrorLayer->getDebugName());
        addClientLayer(mirrorArgs, outResult.handle, rootMirrorLayer /* layer */,
                       nullptr /* parent */, nullptr /* outTransformHint */);
    }
    addClientLayer(mirrorArgs, outResult.handle, rootMirrorLayer /* layer */, nullptr /* parent */,
                   nullptr /* outTransformHint */);

    setTransactionFlags(eTransactionFlushNeeded);
    return NO_ERROR;