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

Commit 136e2f65 authored by Robert Carr's avatar Robert Carr
Browse files

Remove erroneous log message

It seems we always get a duplicate remove from the layer-cleaner
so this was showing up any time any layer was removed. We didn't have
this message before the child layers CL so lets get rid of it quickly.

Test: Deleting a line of logging code. It builds!
Change-Id: I16cc0c0b325e43d36cae684b06a93c099baa1aa6
parent 1614c1e9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2539,11 +2539,18 @@ status_t SurfaceFlinger::removeLayer(const wp<Layer>& weakLayer) {
    const ssize_t index = (p != nullptr) ? p->removeChild(layer) :
        mCurrentState.layersSortedByZ.remove(layer);

    if (index < 0) {
    // As a matter of normal operation, the LayerCleaner will produce a second
    // attempt to remove the surface. The Layer will be kept alive in mDrawingState
    // so we will succeed in promoting it, but it's already been removed
    // from mCurrentState. As long as we can find it in mDrawingState we have no problem
    // otherwise something has gone wrong and we are leaking the layer.
    if (index < 0 && mDrawingState.layersSortedByZ.indexOf(layer) < 0) {
        ALOGE("Failed to find layer (%s) in layer parent (%s).",
                layer->getName().string(),
                (p != nullptr) ? p->getName().string() : "no-parent");
        return BAD_VALUE;
    } else if (index < 0) {
        return NO_ERROR;
    }

    mLayersPendingRemoval.add(layer);
+8 −1
Original line number Diff line number Diff line
@@ -2325,11 +2325,18 @@ status_t SurfaceFlinger::removeLayer(const wp<Layer>& weakLayer) {
    const ssize_t index = (p != nullptr) ? p->removeChild(layer) :
             mCurrentState.layersSortedByZ.remove(layer);

    if (index < 0) {
    // As a matter of normal operation, the LayerCleaner will produce a second
    // attempt to remove the surface. The Layer will be kept alive in mDrawingState
    // so we will succeed in promoting it, but it's already been removed
    // from mCurrentState. As long as we can find it in mDrawingState we have no problem
    // otherwise something has gone wrong and we are leaking the layer.
    if (index < 0 && mDrawingState.layersSortedByZ.indexOf(layer) < 0) {
        ALOGE("Failed to find layer (%s) in layer parent (%s).",
                layer->getName().string(),
                (p != nullptr) ? p->getName().string() : "no-parent");
        return BAD_VALUE;
    } else if (index < 0) {
        return NO_ERROR;
    }

    mLayersPendingRemoval.add(layer);