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

Commit 63a49903 authored by Wonsik Kim's avatar Wonsik Kim Committed by Gerrit Code Review
Browse files

Merge "Add toString() to HardwareBuffer"

parents 8c49cc5e 39a38d47
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;