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

Commit 604a7bc6 authored by Wonsik Kim's avatar Wonsik Kim Committed by Automerger Merge Worker
Browse files

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

parents 3fbbea31 63a49903
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,10 @@
#include <android/hardware_buffer.h>
#include <android/hardware_buffer.h>
#include <sys/cdefs.h>
#include <sys/cdefs.h>


#ifdef __cplusplus
#include <string>
#endif

__BEGIN_DECLS
__BEGIN_DECLS


/**
/**
@@ -135,6 +139,15 @@ public:
        return ret;
        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:
private:
    HardwareBuffer(const HardwareBuffer& other) = delete;
    HardwareBuffer(const HardwareBuffer& other) = delete;
    HardwareBuffer& operator=(const HardwareBuffer& other) = delete;
    HardwareBuffer& operator=(const HardwareBuffer& other) = delete;