Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da866106 authored by Harry Cutts's avatar Harry Cutts
Browse files

EventHub: improve error message when populating axis states

The old wording was a little unusual ("absolute controller"?), and
reporting the axis name makes it a bit clearer what's going on.

Bug: 245989146
Test: cause errors by quickly creating and removing a device (see
      b/424789999#comment10) and check the error logs
Flag: EXEMPT log only update
Change-Id: Ie5069b8dd3b8e6523befa720c02db20d8f237fd1
parent 6db41fd6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <linux/input-event-codes.h>
#include <linux/ioctl.h>
#include <memory.h>
#include <stdint.h>
@@ -679,8 +680,10 @@ void EventHub::Device::populateAbsoluteAxisStates() {
        }
        struct input_absinfo info {};
        if (ioctl(fd, EVIOCGABS(axis), &info)) {
            ALOGE("Error reading absolute controller %d for device %s fd %d: %s", axis,
                  identifier.name.c_str(), fd, strerror(errno));
            ALOGE("Error reading axis info for device '%s' axis %s fd %d: %s",
                  identifier.name.c_str(),
                  InputEventLookup::getLinuxEvdevLabel(EV_ABS, axis, 0).code.c_str(), fd,
                  strerror(errno));
            continue;
        }
        auto& [axisInfo, value] = absState[axis];