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

Commit 39a38d47 authored by Sungtak Lee's avatar Sungtak Lee Committed by Wonsik Kim
Browse files

Add toString() to HardwareBuffer

Bug: N/A
Test: m
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2ed5cf9a07889c97d9fc28471934f1115c72736f)
Merged-In: I7452fd53876eacb0a062d5a5c601594de2190ee1
Change-Id: I7452fd53876eacb0a062d5a5c601594de2190ee1
parent 38b89eae
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;