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

Commit 64ac2f9e authored by Harry Cutts's avatar Harry Cutts Committed by Android (Google) Code Review
Browse files

Merge "EventHub: log error when getting axis info for non-existent device" into main

parents e0d984c2 d6a3fb5d
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@
#include <android-base/strings.h>
#include <android-base/strings.h>
#include <cutils/properties.h>
#include <cutils/properties.h>
#include <ftl/enum.h>
#include <ftl/enum.h>
#include <input/InputEventLabels.h>
#include <input/KeyCharacterMap.h>
#include <input/KeyCharacterMap.h>
#include <input/KeyLayoutMap.h>
#include <input/KeyLayoutMap.h>
#include <input/PrintTools.h>
#include <input/PrintTools.h>
@@ -1021,6 +1022,8 @@ std::optional<RawAbsoluteAxisInfo> EventHub::getAbsoluteAxisInfo(int32_t deviceI
    std::scoped_lock _l(mLock);
    std::scoped_lock _l(mLock);
    const Device* device = getDeviceLocked(deviceId);
    const Device* device = getDeviceLocked(deviceId);
    if (device == nullptr) {
    if (device == nullptr) {
        ALOGE("Couldn't find device with ID %d, so returning null axis info for axis %s", deviceId,
              InputEventLookup::getLinuxEvdevLabel(EV_ABS, axis, 0).code.c_str());
        return std::nullopt;
        return std::nullopt;
    }
    }
    // We can read the RawAbsoluteAxisInfo even if the device is disabled and doesn't have a valid
    // We can read the RawAbsoluteAxisInfo even if the device is disabled and doesn't have a valid