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

Commit 13bd0da4 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: Idc04ead37411d1772f9adb3d094d1640ff5668bf
parents 0a58b85e aa8b7ac8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -128,8 +128,9 @@ status_t GraphicBufferAllocator::allocateHelper(uint32_t width, uint32_t height,
    }

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

    // TODO(b/72323293, b/72703005): Remove these invalid bits from callers
    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 "
              "usage %" PRIx64 ": %d",
              width, height, layerCount, format, usage, error);
        return NO_MEMORY;
        return error;
    }

    if (!importBuffer) {