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

Commit d6e7fdca authored by Siarhei Vishniakou's avatar Siarhei Vishniakou Committed by Android (Google) Code Review
Browse files

Revert "TouchInputMapper: Add fatal check expecting x/y axes to always be present"

This reverts commit 6a7626a0.

Reason for revert: b/408327828

Change-Id: I7ba205ef5a0200f791ef40b62767eb72299988bd
parent 6a7626a0
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#include "../Macros.h"

#include <android-base/logging.h>
#include <android/sysprop/InputProperties.sysprop.h>
#include "MultiTouchInputMapper.h"

@@ -188,11 +187,14 @@ std::list<NotifyArgs> MultiTouchInputMapper::reconfigure(nsecs_t when,
void MultiTouchInputMapper::configureRawPointerAxes() {
    TouchInputMapper::configureRawPointerAxes();

    const auto xInfo = getAbsoluteAxisInfo(ABS_MT_POSITION_X);
    const auto yInfo = getAbsoluteAxisInfo(ABS_MT_POSITION_Y);
    LOG_IF(FATAL, !xInfo || !yInfo) << "X/Y axes not found for multi-touch device";
    // TODO(b/351870641): Investigate why we are sometime not getting valid axis infos for the x/y
    //   axes, even though those axes are required to be supported.
    if (const auto xInfo = getAbsoluteAxisInfo(ABS_MT_POSITION_X); xInfo.has_value()) {
        mRawPointerAxes.x = *xInfo;
    }
    if (const auto yInfo = getAbsoluteAxisInfo(ABS_MT_POSITION_Y); yInfo.has_value()) {
        mRawPointerAxes.y = *yInfo;
    }
    mRawPointerAxes.touchMajor = getAbsoluteAxisInfo(ABS_MT_TOUCH_MAJOR);
    mRawPointerAxes.touchMinor = getAbsoluteAxisInfo(ABS_MT_TOUCH_MINOR);
    mRawPointerAxes.toolMajor = getAbsoluteAxisInfo(ABS_MT_WIDTH_MAJOR);
+8 −7
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

#include "SingleTouchInputMapper.h"

#include <android-base/logging.h>

namespace android {

SingleTouchInputMapper::SingleTouchInputMapper(InputDeviceContext& deviceContext,
@@ -74,11 +72,14 @@ void SingleTouchInputMapper::syncTouch(nsecs_t when, RawState* outState) {
void SingleTouchInputMapper::configureRawPointerAxes() {
    TouchInputMapper::configureRawPointerAxes();

    const auto xInfo = getAbsoluteAxisInfo(ABS_X);
    const auto yInfo = getAbsoluteAxisInfo(ABS_Y);
    LOG_IF(FATAL, !xInfo || !yInfo) << "X/Y axes not found for single-touch device";
    // TODO(b/351870641): Investigate why we are sometime not getting valid axis infos for the x/y
    //   axes, even though those axes are required to be supported.
    if (const auto xInfo = getAbsoluteAxisInfo(ABS_X); xInfo.has_value()) {
        mRawPointerAxes.x = *xInfo;
    }
    if (const auto yInfo = getAbsoluteAxisInfo(ABS_Y); yInfo.has_value()) {
        mRawPointerAxes.y = *yInfo;
    }
    mRawPointerAxes.pressure = getAbsoluteAxisInfo(ABS_PRESSURE);
    mRawPointerAxes.toolMajor = getAbsoluteAxisInfo(ABS_TOOL_WIDTH);
    mRawPointerAxes.distance = getAbsoluteAxisInfo(ABS_DISTANCE);
+0 −9
Original line number Diff line number Diff line
@@ -616,15 +616,6 @@ protected:
        mFakeEventHub->addDevice(eventHubId, name, classes);
        mFakeEventHub->setSysfsRootPath(eventHubId, sysfsRootPath);

        // Populate required axis info.
        if (classes.test(InputDeviceClass::TOUCH_MT)) {
            mFakeEventHub->addAbsoluteAxis(eventHubId, ABS_MT_POSITION_X, 0, 1, 0, 0);
            mFakeEventHub->addAbsoluteAxis(eventHubId, ABS_MT_POSITION_Y, 0, 1, 0, 0);
        } else if (classes.test(InputDeviceClass::TOUCH)) {
            mFakeEventHub->addAbsoluteAxis(eventHubId, ABS_X, 0, 1, 0, 0);
            mFakeEventHub->addAbsoluteAxis(eventHubId, ABS_Y, 0, 1, 0, 0);
        }

        if (configuration) {
            mFakeEventHub->addConfigurationMap(eventHubId, configuration);
        }