diff options
author | 2024-01-24 12:47:00 -0800 | |
---|---|---|
committer | 2024-02-01 12:36:56 -0800 | |
commit | b1b96db1eb56bd0df2bdf78d3922e10d65d08925 (patch) | |
tree | cf926df32ac232d15580f6a576f1e229df96c7ae /libs/input/InputDevice.cpp | |
parent | 02c971640a149401a97960019a7236e6212ccf40 (diff) |
Support for InputDevice ViewBehavior
This change creates a struct within InputDeviceInfo to hold View related
behaviors of an input device. Currently, a single behavior is supported:
device.viewBehavior_smoothScroll. This can be specified in an IDC file
to hint clients of the InputDevice that they should animate scrolls for
motion events generated by the InputDevice.
Bug: 246946631
Test: add property in IDC, check API returns expected value
Test: atest frameworks/native/services/inputflinger/tests/InputReader_test.cpp
Change-Id: Ibe373cadc40d2a08116e787b744dd30812638edb
Diffstat (limited to 'libs/input/InputDevice.cpp')
-rw-r--r-- | libs/input/InputDevice.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/input/InputDevice.cpp b/libs/input/InputDevice.cpp index 9c7c0c19ed..d4dbc45090 100644 --- a/libs/input/InputDevice.cpp +++ b/libs/input/InputDevice.cpp @@ -190,14 +190,16 @@ InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) mHasSensor(other.mHasSensor), mMotionRanges(other.mMotionRanges), mSensors(other.mSensors), - mLights(other.mLights) {} + mLights(other.mLights), + mViewBehavior(other.mViewBehavior) {} InputDeviceInfo::~InputDeviceInfo() { } void InputDeviceInfo::initialize(int32_t id, int32_t generation, int32_t controllerNumber, const InputDeviceIdentifier& identifier, const std::string& alias, - bool isExternal, bool hasMic, int32_t associatedDisplayId) { + bool isExternal, bool hasMic, int32_t associatedDisplayId, + InputDeviceViewBehavior viewBehavior) { mId = id; mGeneration = generation; mControllerNumber = controllerNumber; @@ -212,6 +214,7 @@ void InputDeviceInfo::initialize(int32_t id, int32_t generation, int32_t control mHasBattery = false; mHasButtonUnderPad = false; mHasSensor = false; + mViewBehavior = viewBehavior; mUsiVersion.reset(); mMotionRanges.clear(); mSensors.clear(); |