Initialize mAffineTransform and update on modification
This patch causes the InputReader to update its mAffineTransform to reflect
the currently-set calibration on startup and whenever its value is changed
through the InputManagerService.
Change-Id: I4719122a28afa9833772040f0433780a84240b9d
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index 9a4f848..a8ccf8b 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -2752,6 +2752,11 @@
resolveCalibration();
}
+ if (!changes || (changes & InputReaderConfiguration::TOUCH_AFFINE_TRANSFORMATION)) {
+ // Update location calibration to reflect current settings
+ updateAffineTransformation();
+ }
+
if (!changes || (changes & InputReaderConfiguration::CHANGE_POINTER_SPEED)) {
// Update pointer speed.
mPointerVelocityControl.setParameters(mConfig.pointerVelocityControlParameters);
@@ -3654,6 +3659,10 @@
dump.appendFormat(INDENT4 "Y offset: %0.3f\n", mAffineTransform.y_offset);
}
+void TouchInputMapper::updateAffineTransformation() {
+ mAffineTransform = getPolicy()->getTouchAffineTransformation(mDevice->getDescriptor());
+}
+
void TouchInputMapper::reset(nsecs_t when) {
mCursorButtonAccumulator.reset(getDevice());
mCursorScrollAccumulator.reset(getDevice());