summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2024-03-26 21:52:38 +0000
committer Siarhei Vishniakou <svv@google.com> 2024-03-27 15:52:52 +0000
commit11d223bacb37a77abe09b2841bf3a0bcf4c212d3 (patch)
treec3375423123685cd55fce93a65fa6ab536c91fce
parent232f2712d9abc50a421041e5a090d1f1d5c6b601 (diff)
Add the name of channel receiving bad data
When the InputReceiver gets bad data from the other end of the channel, we currently don't print the channel information. As a result, when this crash happens, we only learn about the process name. Add the channel info to this crash so that it's more useful going forward. Bug: 329059530 Change-Id: Iad4c892dee37a9bf35e790781a2c39431d5a146a Test: presubmit
-rw-r--r--libs/input/InputConsumer.cpp7
-rw-r--r--libs/input/InputConsumerNoResampling.cpp7
2 files changed, 7 insertions, 7 deletions
diff --git a/libs/input/InputConsumer.cpp b/libs/input/InputConsumer.cpp
index e0d874ef76..41ecfe3cfd 100644
--- a/libs/input/InputConsumer.cpp
+++ b/libs/input/InputConsumer.cpp
@@ -325,9 +325,10 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory, bool consum
case InputMessage::Type::FINISHED:
case InputMessage::Type::TIMELINE: {
- LOG_ALWAYS_FATAL("Consumed a %s message, which should never be seen by "
- "InputConsumer!",
- ftl::enum_string(mMsg.header.type).c_str());
+ LOG(FATAL) << "Consumed a " << ftl::enum_string(mMsg.header.type)
+ << " message, which should never be seen by "
+ "InputConsumer on "
+ << mChannel->getName();
break;
}
diff --git a/libs/input/InputConsumerNoResampling.cpp b/libs/input/InputConsumerNoResampling.cpp
index 52acb51910..76f2b4a4f8 100644
--- a/libs/input/InputConsumerNoResampling.cpp
+++ b/libs/input/InputConsumerNoResampling.cpp
@@ -413,10 +413,9 @@ void InputConsumerNoResampling::handleMessage(const InputMessage& msg) const {
case InputMessage::Type::FINISHED:
case InputMessage::Type::TIMELINE: {
- LOG_ALWAYS_FATAL("Consumed a %s message, which should never be seen by "
- "InputConsumer on %s",
- ftl::enum_string(msg.header.type).c_str(),
- mChannel->getName().c_str());
+ LOG(FATAL) << "Consumed a " << ftl::enum_string(msg.header.type)
+ << " message, which should never be seen by InputConsumer on "
+ << mChannel->getName();
break;
}