From 691126585a46b57044a72483c54e7bff291c6427 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Thu, 24 Aug 2023 08:34:18 -0700 Subject: Don't log when there are no more messages Throughout input code, we check for presence of messages by looking at the return code of various read functions. These are usually infinite reads that get terminated when EWOULDBLOCK is received. This is guaranteed to be hit every time (otherwise, we would get an infinite loop). So in this CL, we remove the misleading log about EWOULDBLOCK, which looks like this: InputTransport: channel '...WindowInputTests$TestActivity (server)' publisher ~ receiveConsumerResponse: finished: seq=2966, handled=false InputTransport: channel '...WindowInputTests$TestActivity (server)' publisher ~ receiveConsumerResponse: Unknown error -11 Bug: 282957027 Test: logcatcolor | grep -i input Change-Id: Ie83fc1c9b69c02d8c48ebebaf4e57e0f76c9a3d9 --- libs/input/InputTransport.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/input/InputTransport.cpp b/libs/input/InputTransport.cpp index 3446540ccf..5e51bc6cc5 100644 --- a/libs/input/InputTransport.cpp +++ b/libs/input/InputTransport.cpp @@ -791,8 +791,10 @@ android::base::Result InputPublisher::receiveC InputMessage msg; status_t result = mChannel->receiveMessage(&msg); if (result) { - ALOGD_IF(debugTransportPublisher(), "channel '%s' publisher ~ %s: %s", - mChannel->getName().c_str(), __func__, strerror(result)); + if (debugTransportPublisher() && result != WOULD_BLOCK) { + LOG(INFO) << "channel '" << mChannel->getName() << "' publisher ~ " << __func__ << ": " + << strerror(result); + } return android::base::Error(result); } if (msg.header.type == InputMessage::Type::FINISHED) { -- cgit v1.2.3-59-g8ed1b