Move ADISPLAY_ID_ definitions into LogicalDisplayId
These will eventually replace the existing definitions as follows:
ADISPLAY_ID_NONE -->> LogicalDisplayId::INVALID
ADISPLAY_ID_DEFAULT -->> LogicalDisplayId::DEFAULT
We are keeping the old definitions for now, to reduce the merge
conflicts. These will be removed in subsequent CLs, after the
frameworks/base and other repository patches go in.
The constant "NONE" was renamed to "INVALID" to make it consistent with
the Java definitions.
Bug: 339106983
Test: m checkinput
Change-Id: I0274be345159c85cb51fcea743d8acd3d298cd07
diff --git a/services/inputflinger/tests/FakeWindows.h b/services/inputflinger/tests/FakeWindows.h
index 8a40337..36a8f00 100644
--- a/services/inputflinger/tests/FakeWindows.h
+++ b/services/inputflinger/tests/FakeWindows.h
@@ -261,22 +261,24 @@
}
inline void consumeMotionCancel(
- ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
int32_t expectedFlags = 0) {
consumeMotionEvent(testing::AllOf(WithMotionAction(AMOTION_EVENT_ACTION_CANCEL),
WithDisplayId(expectedDisplayId),
WithFlags(expectedFlags | AMOTION_EVENT_FLAG_CANCELED)));
}
- inline void consumeMotionMove(ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
- int32_t expectedFlags = 0) {
+ inline void consumeMotionMove(
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
+ int32_t expectedFlags = 0) {
consumeMotionEvent(testing::AllOf(WithMotionAction(AMOTION_EVENT_ACTION_MOVE),
WithDisplayId(expectedDisplayId),
WithFlags(expectedFlags)));
}
- inline void consumeMotionDown(ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
- int32_t expectedFlags = 0) {
+ inline void consumeMotionDown(
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
+ int32_t expectedFlags = 0) {
consumeAnyMotionDown(expectedDisplayId, expectedFlags);
}
@@ -292,7 +294,8 @@
}
inline void consumeMotionPointerDown(
- int32_t pointerIdx, ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
+ int32_t pointerIdx,
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
int32_t expectedFlags = 0) {
const int32_t action = AMOTION_EVENT_ACTION_POINTER_DOWN |
(pointerIdx << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT);
@@ -302,7 +305,8 @@
}
inline void consumeMotionPointerUp(
- int32_t pointerIdx, ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
+ int32_t pointerIdx,
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
int32_t expectedFlags = 0) {
const int32_t action = AMOTION_EVENT_ACTION_POINTER_UP |
(pointerIdx << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT);
@@ -311,15 +315,16 @@
WithFlags(expectedFlags)));
}
- inline void consumeMotionUp(ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
- int32_t expectedFlags = 0) {
+ inline void consumeMotionUp(
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
+ int32_t expectedFlags = 0) {
consumeMotionEvent(testing::AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP),
WithDisplayId(expectedDisplayId),
WithFlags(expectedFlags)));
}
inline void consumeMotionOutside(
- ui::LogicalDisplayId expectedDisplayId = ui::ADISPLAY_ID_DEFAULT,
+ ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
int32_t expectedFlags = 0) {
consumeMotionEvent(testing::AllOf(WithMotionAction(AMOTION_EVENT_ACTION_OUTSIDE),
WithDisplayId(expectedDisplayId),