Remove warning when associated display is ADISPLAY_ID_NONE.
This warning caused logspam in emulator system image because emulator
host pre-registeris several touch screen devices which are not associated
with any display until multi-display feature is turned on. Unfortunately,
there is no easy way to add/remove touch screen device on-demand in
emulator host at runtime.
Bug: 160609749
Signed-off-by: Weilun Du <wdu@google.com>
Change-Id: I78d8c1b18285a58887b107d5469f9d1703132b44
diff --git a/services/inputflinger/reader/InputReader.cpp b/services/inputflinger/reader/InputReader.cpp
index 0b632f7..30f25e5 100644
--- a/services/inputflinger/reader/InputReader.cpp
+++ b/services/inputflinger/reader/InputReader.cpp
@@ -782,12 +782,8 @@
std::optional<int32_t> associatedDisplayId = device->getAssociatedDisplayId();
// No associated display. By default, can dispatch to all displays.
- if (!associatedDisplayId) {
- return true;
- }
-
- if (*associatedDisplayId == ADISPLAY_ID_NONE) {
- ALOGW("Device %s is associated with display ADISPLAY_ID_NONE.", device->getName().c_str());
+ if (!associatedDisplayId ||
+ *associatedDisplayId == ADISPLAY_ID_NONE) {
return true;
}