InputDispatcher: dump window in a separate function
This makes it more convenient to dump windows from other places during
debugging. For example, this could also be called from setInputWindows
to inspect all of the window flags that might be changing.
Bug: 312714754
Test: adb shell dumpsys input
Change-Id: I2ace23bec1231f3a318e1b6a19f146b588e077b6
diff --git a/include/input/PrintTools.h b/include/input/PrintTools.h
index 63c0e40..83fffa3 100644
--- a/include/input/PrintTools.h
+++ b/include/input/PrintTools.h
@@ -20,6 +20,7 @@
#include <map>
#include <optional>
#include <set>
+#include <sstream>
#include <string>
#include <vector>
@@ -33,6 +34,13 @@
return bitset.to_string();
}
+template <class T>
+std::string streamableToString(const T& streamable) {
+ std::stringstream out;
+ out << streamable;
+ return out.str();
+}
+
template <typename T>
inline std::string constToString(const T& v) {
return std::to_string(v);