Move things in InputWindowInfo to enum classes
Also introduce a new Flag class to make it possible to deal with flags
while treating the individual flags as part of an enum class in a type
safe manner.
Bug: 160010896
Test: atest inputflinger_tests, atest libinput_tests
Change-Id: I915a1c1e3b31f1c0fd99b83ba5fad7e537cd6f84
diff --git a/libs/input/tests/InputWindow_test.cpp b/libs/input/tests/InputWindow_test.cpp
index cdea922..e7a4587 100644
--- a/libs/input/tests/InputWindow_test.cpp
+++ b/libs/input/tests/InputWindow_test.cpp
@@ -44,8 +44,8 @@
i.token = new BBinder();
i.id = 1;
i.name = "Foobar";
- i.layoutParamsFlags = 7;
- i.layoutParamsType = 39;
+ i.flags = InputWindowInfo::Flag::SLIPPERY;
+ i.type = InputWindowInfo::Type::INPUT_METHOD;
i.dispatchingTimeout = 12s;
i.frameLeft = 93;
i.frameTop = 34;
@@ -62,7 +62,7 @@
i.paused = false;
i.ownerPid = 19;
i.ownerUid = 24;
- i.inputFeatures = 29;
+ i.inputFeatures = InputWindowInfo::Feature::DISABLE_USER_ACTIVITY;
i.displayId = 34;
i.portalToDisplayId = 2;
i.replaceTouchableRegionWithCrop = true;
@@ -76,8 +76,8 @@
ASSERT_EQ(i.token, i2.token);
ASSERT_EQ(i.id, i2.id);
ASSERT_EQ(i.name, i2.name);
- ASSERT_EQ(i.layoutParamsFlags, i2.layoutParamsFlags);
- ASSERT_EQ(i.layoutParamsType, i2.layoutParamsType);
+ ASSERT_EQ(i.flags, i2.flags);
+ ASSERT_EQ(i.type, i2.type);
ASSERT_EQ(i.dispatchingTimeout, i2.dispatchingTimeout);
ASSERT_EQ(i.frameLeft, i2.frameLeft);
ASSERT_EQ(i.frameTop, i2.frameTop);