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

Commit 504194d5 authored by Tim Van Patten's avatar Tim Van Patten Committed by Automerger Merge Worker
Browse files

Return error code directly in allocateHelper() am: aa8b7ac8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14806071

Change-Id: Id33b9e9e384b95b1d6b6918c81ab074a45807be4
parents d5300e4f aa8b7ac8
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -128,8 +128,9 @@ status_t GraphicBufferAllocator::allocateHelper(uint32_t width, uint32_t height,
    }
    }


    // Ensure that layerCount is valid.
    // Ensure that layerCount is valid.
    if (layerCount < 1)
    if (layerCount < 1) {
        layerCount = 1;
        layerCount = 1;
    }


    // TODO(b/72323293, b/72703005): Remove these invalid bits from callers
    // TODO(b/72323293, b/72703005): Remove these invalid bits from callers
    usage &= ~static_cast<uint64_t>((1 << 10) | (1 << 13));
    usage &= ~static_cast<uint64_t>((1 << 10) | (1 << 13));
@@ -140,7 +141,7 @@ status_t GraphicBufferAllocator::allocateHelper(uint32_t width, uint32_t height,
        ALOGE("Failed to allocate (%u x %u) layerCount %u format %d "
        ALOGE("Failed to allocate (%u x %u) layerCount %u format %d "
              "usage %" PRIx64 ": %d",
              "usage %" PRIx64 ": %d",
              width, height, layerCount, format, usage, error);
              width, height, layerCount, format, usage, error);
        return NO_MEMORY;
        return error;
    }
    }


    if (!importBuffer) {
    if (!importBuffer) {