summaryrefslogtreecommitdiff
path: root/include/input/PrintTools.h
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2022-12-07 20:23:06 +0000
committer Siarhei Vishniakou <svv@google.com> 2023-01-19 07:44:13 -0800
commitb581f7f0d2aa1f385de2be47c1f3773795d2c131 (patch)
tree67cf3ff4e962b5e6816a7f011bc9c7c64ebc8f1e /include/input/PrintTools.h
parentae0b8d1d9bbada6795d81ab20f7470cb4f3cdc60 (diff)
Track hovering pointers explicitly -- try 2
Update: Compared to the first version of this CL that got reverted, this version also adds Flags::FOREGROUND to the windows whenever appropriate. Before this CL, hovering window was tracked separately inside InputDispatcher. This window was getting updated in various places. Inconsistent motion streams, like HOVER_ENTER->DOWN->UP->HOVER_EXIT were possible. In this CL, we track hovering pointers inside TouchedWindow. At all times, the currently tracked pointer must always be in the touch state. The hovering pointer is removed when HOVER_EXIT is received. This CL also establishes the foundation for multi-device, multi-pointer streams, by storing hovering pointers inside TouchedWindow per-device. Eventually, we can look into separately creating touched targets from updating the touch state. This approach is partially used in this CL. TouchState is used to keep track of where the hovering pointer is currently. The 'addHoveringWindowsLocked' function returns the equivalent of InputTargets. Eventually, we can change this to return InputTargets. 39d37cfb471c69f924e90f8e35afcff4ad4e6042 Bug: 211379801 Test: atest android.accessibilityservice.cts.AccessibilityEndToEndTest Test: atest VirtualMouseTest Test: m inputflinger_tests && adb sync data && adb shell -t /data/nativetest64/inputflinger_tests/inputflinger_tests Change-Id: I0aa77bc9f680786b154312c4c936da2cf6efffa1
Diffstat (limited to 'include/input/PrintTools.h')
-rw-r--r--include/input/PrintTools.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/input/PrintTools.h b/include/input/PrintTools.h
index e24344b3f1..a20544b5fd 100644
--- a/include/input/PrintTools.h
+++ b/include/input/PrintTools.h
@@ -16,6 +16,7 @@
#pragma once
+#include <bitset>
#include <map>
#include <optional>
#include <set>
@@ -23,6 +24,11 @@
namespace android {
+template <size_t N>
+std::string bitsetToString(const std::bitset<N>& bitset) {
+ return bitset.to_string();
+}
+
template <typename T>
inline std::string constToString(const T& v) {
return std::to_string(v);