TouchpadInputMapper: add dump method
This dumps the state from the gesture converter, and a list of gesture
properties, which is useful for debugging settings.
Bug: 251196347
Test: run dumpsys input with touchpad connected, check output
Change-Id: I036d0251b06489b645b883a239ff345a98448497
diff --git a/services/inputflinger/reader/mapper/InputMapper.cpp b/services/inputflinger/reader/mapper/InputMapper.cpp
index 8e3539c..ba2ea99 100644
--- a/services/inputflinger/reader/mapper/InputMapper.cpp
+++ b/services/inputflinger/reader/mapper/InputMapper.cpp
@@ -18,6 +18,8 @@
#include "InputMapper.h"
+#include <sstream>
+
#include "InputDevice.h"
#include "input/PrintTools.h"
@@ -120,12 +122,9 @@
void InputMapper::dumpRawAbsoluteAxisInfo(std::string& dump, const RawAbsoluteAxisInfo& axis,
const char* name) {
- if (axis.valid) {
- dump += StringPrintf(INDENT4 "%s: min=%d, max=%d, flat=%d, fuzz=%d, resolution=%d\n", name,
- axis.minValue, axis.maxValue, axis.flat, axis.fuzz, axis.resolution);
- } else {
- dump += StringPrintf(INDENT4 "%s: unknown range\n", name);
- }
+ std::stringstream out;
+ out << INDENT4 << name << ": " << axis << "\n";
+ dump += out.str();
}
void InputMapper::dumpStylusState(std::string& dump, const StylusState& state) {