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

Commit c9e53047 authored by Michael Wright's avatar Michael Wright
Browse files

Add dump to DisplayInfo.

This way it can be dumped as part of PointerController's dump.

Bug: 254277939
Test: manually inspect `dumpsys input`
Change-Id: I9ad71d14c81af390f5b9ccb4fa75439bd4496c26
parent 08f7a6ad
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -20,8 +20,13 @@
#include <gui/DisplayInfo.h>
#include <private/gui/ParcelUtils.h>

#include <android-base/stringprintf.h>
#include <log/log.h>

#include <inttypes.h>

#define INDENT "  "

namespace android::gui {

// --- DisplayInfo ---
@@ -67,4 +72,17 @@ status_t DisplayInfo::writeToParcel(android::Parcel* parcel) const {
    return OK;
}

void DisplayInfo::dump(std::string& out, const char* prefix) const {
    using android::base::StringAppendF;

    out += prefix;
    StringAppendF(&out, "DisplayViewport[id=%" PRId32 "]\n", displayId);
    out += prefix;
    StringAppendF(&out, INDENT "Width=%" PRId32 ", Height=%" PRId32 "\n", logicalWidth,
                  logicalHeight);
    std::string transformPrefix(prefix);
    transformPrefix.append(INDENT);
    transform.dump(out, "Transform", transformPrefix.c_str());
}

} // namespace android::gui
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ struct DisplayInfo : public Parcelable {
    status_t writeToParcel(android::Parcel*) const override;

    status_t readFromParcel(const android::Parcel*) override;

    void dump(std::string& result, const char* prefix = "") const;
};

} // namespace android::gui
 No newline at end of file