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

Commit 2cf827fa authored by Ying Wei's avatar Ying Wei
Browse files

Grab lock before reparenting in SurfaceFlinger commitMirrorDisplays()

Bug: 271644537
Test: n/a
Change-Id: I45384210791bd9280f63d95e3bdaef3d299fc818
(cherry picked from commit 9cba62a0)
Merged-In: I45384210791bd9280f63d95e3bdaef3d299fc818
parent 68ca576a
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -7913,10 +7913,15 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) {
                                         ISurfaceComposerClient::eNoColorFill,
                                         gui::LayerMetadata());
            sp<Layer> childMirror;
            {
                Mutex::Autolock lock(mStateLock);
                createEffectLayer(mirrorArgs, &unused, &childMirror);
                childMirror->setClonedChild(layer->createClone());
                childMirror->reparent(mirrorDisplay.rootHandle);
            }
            // lock on mStateLock needs to be released before binder handle gets destroyed
            unused.clear();
        }
    }
    return true;
}