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

Commit 58e2b50b authored by Sungtak Lee's avatar Sungtak Lee Committed by Android (Google) Code Review
Browse files

Merge "Add toString() to HardwareBuffer"

parents 5dc0afc8 2ed5cf9a
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

/**
@@ -142,6 +146,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;