summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2023-12-06 11:23:41 -0800
committerSiarhei Vishniakou <svv@google.com>2023-12-11 17:16:34 +0000
commit366fb5bfcb2fd14504da9702759b431840bd0caf (patch)
tree5d2b4878d776ca5e3026807d5b6696ba7235133c /include
parentd28755ab6ca790ba041bfed69a0b28a4375c205f (diff)
downloadnative-366fb5bfcb2fd14504da9702759b431840bd0caf.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/input/PrintTools.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/input/PrintTools.h b/include/input/PrintTools.h
index 63c0e40e4e..83fffa37c6 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 @@ std::string bitsetToString(const std::bitset<N>& bitset) {
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);