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

Commit ce0489d2 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "SurfaceFlinger: Fix layer creation race"

parents abf5f9aa 86e11906
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -3572,15 +3572,16 @@ status_t SurfaceFlinger::addClientLayer(const sp<Client>& client, const sp<IBind
        return NO_MEMORY;
        return NO_MEMORY;
    }
    }


    layer->updateTransformHint(mActiveDisplayTransformHint);
    if (outTransformHint) {
        *outTransformHint = mActiveDisplayTransformHint;
    }

    {
    {
        std::scoped_lock<std::mutex> lock(mCreatedLayersLock);
        std::scoped_lock<std::mutex> lock(mCreatedLayersLock);
        mCreatedLayers.emplace_back(layer, parent, addToRoot);
        mCreatedLayers.emplace_back(layer, parent, addToRoot);
    }
    }


    layer->updateTransformHint(mActiveDisplayTransformHint);
    if (outTransformHint) {
        *outTransformHint = mActiveDisplayTransformHint;
    }
    // attach this layer to the client
    // attach this layer to the client
    if (client != nullptr) {
    if (client != nullptr) {
        client->attachLayer(handle, layer);
        client->attachLayer(handle, layer);