Use std::bitset for tracking pointers in the dispatcher
Convert pointerIds to std::bitset. This will allow us to do
bitwise operations with other fields that already use std::bitset.
Bug: 211379801
Test: m inputflinger_tests && $ANDROID_HOST_OUT/nativetest64/inputflinger_tests/inputflinger_tests
Change-Id: I0347b5e171a0597fc88ba628f40dcf6cd59ea093
diff --git a/services/inputflinger/dispatcher/InputTarget.h b/services/inputflinger/dispatcher/InputTarget.h
index 61b07fe..7b12f81 100644
--- a/services/inputflinger/dispatcher/InputTarget.h
+++ b/services/inputflinger/dispatcher/InputTarget.h
@@ -21,6 +21,7 @@
#include <input/InputTransport.h>
#include <ui/Transform.h>
#include <utils/BitSet.h>
+#include <bitset>
namespace android::inputdispatcher {
@@ -105,7 +106,7 @@
// The subset of pointer ids to include in motion events dispatched to this input target
// if FLAG_SPLIT is set.
- BitSet32 pointerIds;
+ std::bitset<MAX_POINTER_ID + 1> pointerIds;
// Event time for the first motion event (ACTION_DOWN) dispatched to this input target if
// FLAG_SPLIT is set.
std::optional<nsecs_t> firstDownTimeInTarget;
@@ -113,7 +114,7 @@
// Transform per pointerId.
ui::Transform pointerTransforms[MAX_POINTERS];
- void addPointers(BitSet32 pointerIds, const ui::Transform& transform);
+ void addPointers(std::bitset<MAX_POINTER_ID + 1> pointerIds, const ui::Transform& transform);
void setDefaultPointerTransform(const ui::Transform& transform);
/**