diff options
| author | 2022-01-05 16:11:48 -0800 | |
|---|---|---|
| committer | 2022-01-24 11:09:52 -0800 | |
| commit | 46d8a1e86d7a922c3ba4b08ccdd05e01ed4d9175 (patch) | |
| tree | 97db70ef810567c59cdf69ef0413e8a3aa11969a | |
| parent | 6db68e1d8390a145bbfeb62e2f392052b1d5868a (diff) | |
Add pointer acceleration native APIs
Bug: 202273865
Test: manual
Change-Id: I61cca8e313f183ff421147d25f11819959e4345a
| -rw-r--r-- | libs/input/android/os/IInputConstants.aidl | 3 | ||||
| -rw-r--r-- | services/inputflinger/include/InputReaderBase.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libs/input/android/os/IInputConstants.aidl b/libs/input/android/os/IInputConstants.aidl index 829bbdd0b7..265cbf0c0b 100644 --- a/libs/input/android/os/IInputConstants.aidl +++ b/libs/input/android/os/IInputConstants.aidl @@ -95,4 +95,7 @@ interface IInputConstants */ INTERCEPTS_STYLUS = 0x00000040, } + + /* The default pointer acceleration value. */ + const int DEFAULT_POINTER_ACCELERATION = 3; } diff --git a/services/inputflinger/include/InputReaderBase.h b/services/inputflinger/include/InputReaderBase.h index 1ab86f6c27..41ecef365d 100644 --- a/services/inputflinger/include/InputReaderBase.h +++ b/services/inputflinger/include/InputReaderBase.h @@ -17,6 +17,7 @@ #ifndef _UI_INPUT_READER_BASE_H #define _UI_INPUT_READER_BASE_H +#include <android/os/IInputConstants.h> #include <input/DisplayViewport.h> #include <input/Input.h> #include <input/InputDevice.h> @@ -288,7 +289,10 @@ struct InputReaderConfiguration { InputReaderConfiguration() : virtualKeyQuietTime(0), - pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f, 3.0f), + pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f, + static_cast<float>( + android::os::IInputConstants:: + DEFAULT_POINTER_ACCELERATION)), wheelVelocityControlParameters(1.0f, 15.0f, 50.0f, 4.0f), pointerGesturesEnabled(true), pointerGestureQuietInterval(100 * 1000000LL), // 100 ms |