Add support to mouse controlled scrolling
Bug: 383555305
Test: N/A
Flag: com.android.hardware.input.mouse_scrolling_acceleration
Change-Id: I26c39339f0ec8b557d42a350731e3e6a2ba0a8db
diff --git a/libs/input/android/os/IInputConstants.aidl b/libs/input/android/os/IInputConstants.aidl
index 31592cd..6ce3fba 100644
--- a/libs/input/android/os/IInputConstants.aidl
+++ b/libs/input/android/os/IInputConstants.aidl
@@ -76,6 +76,9 @@
/* The default pointer acceleration value. */
const int DEFAULT_POINTER_ACCELERATION = 3;
+ /* The default mouse wheel acceleration value. */
+ const int DEFAULT_MOUSE_WHEEL_ACCELERATION = 4;
+
/**
* Use the default Velocity Tracker Strategy. Different axes may use different default
* strategies.
diff --git a/services/inputflinger/include/InputReaderBase.h b/services/inputflinger/include/InputReaderBase.h
index 4d6b6c7..42b269e 100644
--- a/services/inputflinger/include/InputReaderBase.h
+++ b/services/inputflinger/include/InputReaderBase.h
@@ -279,7 +279,10 @@
static_cast<float>(
android::os::IInputConstants::
DEFAULT_POINTER_ACCELERATION)),
- wheelVelocityControlParameters(1.0f, 15.0f, 50.0f, 4.0f),
+ wheelVelocityControlParameters(1.0f, 15.0f, 50.0f,
+ static_cast<float>(
+ android::os::IInputConstants::
+ DEFAULT_MOUSE_WHEEL_ACCELERATION)),
pointerGesturesEnabled(true),
pointerGestureQuietInterval(100 * 1000000LL), // 100 ms
pointerGestureDragMinSwitchSpeed(50), // 50 pixels per second