Loading services/inputflinger/reader/InputDevice.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,10 @@ std::list<NotifyArgs> InputDevice::configure(nsecs_t when, const InputReaderConf } } if (!changes || (changes & InputReaderConfiguration::CHANGE_ENABLED_STATE)) { if (changes & InputReaderConfiguration::CHANGE_ENABLED_STATE) { // Do not execute this code on the first configure, because 'setEnabled' would call // InputMapper::reset, and you can't reset a mapper before it has been configured. // The mappers are configured for the first time at the bottom of this function. auto it = config->disabledDevices.find(mId); bool enabled = it == config->disabledDevices.end(); out += setEnabled(enabled, when); Loading services/inputflinger/tests/InputReader_test.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include <gtest/gtest.h> #include <gui/constants.h> #include <thread> #include "android/hardware/input/InputDeviceCountryCode.h" #include "input/DisplayViewport.h" #include "input/Input.h" Loading Loading @@ -141,6 +142,16 @@ static void assertAxisNotPresent(MultiTouchInputMapper& mapper, int axis) { ASSERT_EQ(nullptr, motionRange); } [[maybe_unused]] static void dumpReader(InputReader& reader) { std::string dump; reader.dump(dump); std::istringstream iss(dump); for (std::string line; std::getline(iss, line);) { ALOGE("%s", line.c_str()); std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } // --- FakePointerController --- class FakePointerController : public PointerControllerInterface { Loading Loading @@ -758,7 +769,7 @@ private: status_t getAbsoluteAxisInfo(int32_t deviceId, int axis, RawAbsoluteAxisInfo* outAxisInfo) const override { Device* device = getDevice(deviceId); if (device && device->enabled) { if (device) { ssize_t index = device->absoluteAxes.indexOfKey(axis); if (index >= 0) { *outAxisInfo = device->absoluteAxes.valueAt(index); Loading Loading
services/inputflinger/reader/InputDevice.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,10 @@ std::list<NotifyArgs> InputDevice::configure(nsecs_t when, const InputReaderConf } } if (!changes || (changes & InputReaderConfiguration::CHANGE_ENABLED_STATE)) { if (changes & InputReaderConfiguration::CHANGE_ENABLED_STATE) { // Do not execute this code on the first configure, because 'setEnabled' would call // InputMapper::reset, and you can't reset a mapper before it has been configured. // The mappers are configured for the first time at the bottom of this function. auto it = config->disabledDevices.find(mId); bool enabled = it == config->disabledDevices.end(); out += setEnabled(enabled, when); Loading
services/inputflinger/tests/InputReader_test.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include <gtest/gtest.h> #include <gui/constants.h> #include <thread> #include "android/hardware/input/InputDeviceCountryCode.h" #include "input/DisplayViewport.h" #include "input/Input.h" Loading Loading @@ -141,6 +142,16 @@ static void assertAxisNotPresent(MultiTouchInputMapper& mapper, int axis) { ASSERT_EQ(nullptr, motionRange); } [[maybe_unused]] static void dumpReader(InputReader& reader) { std::string dump; reader.dump(dump); std::istringstream iss(dump); for (std::string line; std::getline(iss, line);) { ALOGE("%s", line.c_str()); std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } // --- FakePointerController --- class FakePointerController : public PointerControllerInterface { Loading Loading @@ -758,7 +769,7 @@ private: status_t getAbsoluteAxisInfo(int32_t deviceId, int axis, RawAbsoluteAxisInfo* outAxisInfo) const override { Device* device = getDevice(deviceId); if (device && device->enabled) { if (device) { ssize_t index = device->absoluteAxes.indexOfKey(axis); if (index >= 0) { *outAxisInfo = device->absoluteAxes.valueAt(index); Loading