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/libs/gui/include/gui/DisplayInfo.h b/libs/gui/include/gui/DisplayInfo.h
index 7282b80..7094658 100644
--- a/libs/gui/include/gui/DisplayInfo.h
+++ b/libs/gui/include/gui/DisplayInfo.h
@@ -29,7 +29,7 @@
* This should only be used by InputFlinger to support raw coordinates in logical display space.
*/
struct DisplayInfo : public Parcelable {
- ui::LogicalDisplayId displayId = ui::ADISPLAY_ID_NONE;
+ ui::LogicalDisplayId displayId = ui::LogicalDisplayId::INVALID;
// Logical display dimensions.
int32_t logicalWidth = 0;
diff --git a/libs/gui/include/gui/WindowInfo.h b/libs/gui/include/gui/WindowInfo.h
index 3ea3f67..eb3be55 100644
--- a/libs/gui/include/gui/WindowInfo.h
+++ b/libs/gui/include/gui/WindowInfo.h
@@ -234,7 +234,7 @@
Uid ownerUid = Uid::INVALID;
std::string packageName;
ftl::Flags<InputConfig> inputConfig;
- ui::LogicalDisplayId displayId = ui::ADISPLAY_ID_NONE;
+ ui::LogicalDisplayId displayId = ui::LogicalDisplayId::INVALID;
InputApplicationInfo applicationInfo;
bool replaceTouchableRegionWithCrop = false;
wp<IBinder> touchableRegionCropHandle;
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp
index c0e7965..45e3390 100644
--- a/libs/gui/tests/EndToEndNativeInputTest.cpp
+++ b/libs/gui/tests/EndToEndNativeInputTest.cpp
@@ -59,8 +59,6 @@
using android::gui::InputApplicationInfo;
using android::gui::TouchOcclusionMode;
using android::gui::WindowInfo;
-using android::ui::ADISPLAY_ID_DEFAULT;
-using android::ui::ADISPLAY_ID_NONE;
namespace android {
namespace {
@@ -313,7 +311,7 @@
reportedListener->wait();
}
- void requestFocus(ui::LogicalDisplayId displayId = ADISPLAY_ID_DEFAULT) {
+ void requestFocus(ui::LogicalDisplayId displayId = ui::LogicalDisplayId::DEFAULT) {
SurfaceComposerClient::Transaction t;
FocusRequest request;
request.token = mInputInfo.token;
@@ -438,7 +436,7 @@
}
void injectTap(int x, int y) {
- injectTapOnDisplay(x, y, ADISPLAY_ID_DEFAULT);
+ injectTapOnDisplay(x, y, ui::LogicalDisplayId::DEFAULT);
}
void injectKeyOnDisplay(uint32_t keycode, ui::LogicalDisplayId displayId) {
@@ -451,7 +449,7 @@
}
void injectKey(uint32_t keycode) {
- injectKeyOnDisplay(keycode, ADISPLAY_ID_NONE);
+ injectKeyOnDisplay(keycode, ui::LogicalDisplayId::INVALID);
}
TEST_F(InputSurfacesTest, can_receive_input) {