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

Commit 0c5649f4 authored by Wonsik Kim's avatar Wonsik Kim Committed by Automerger Merge Worker
Browse files

Merge "Add toString() to HardwareBuffer" am: 63a49903 am: 604a7bc6

parents 1cf9f8d3 604a7bc6
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@
#include <android/hardware_buffer.h>
#include <sys/cdefs.h>

#ifdef __cplusplus
#include <string>
#endif

__BEGIN_DECLS

/**
@@ -135,6 +139,15 @@ public:
        return ret;
    }

    inline std::string toString() const {
        if (!mBuffer) {
            return "<HardwareBuffer: Invalid>";
        }
        uint64_t id = 0;
        AHardwareBuffer_getId(mBuffer, &id);
        return "<HardwareBuffer " + std::to_string(id) + ">";
    }

private:
    HardwareBuffer(const HardwareBuffer& other) = delete;
    HardwareBuffer& operator=(const HardwareBuffer& other) = delete;