summaryrefslogtreecommitdiffstats
path: root/services/inputflinger/InputReader.cpp
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2014-01-27 18:34:20 -0800
committerMichael Wright <michaelwr@google.com>2014-03-10 14:23:59 -0700
commit12d6baa9b832f16a28f048ed5ffab75a76ed9c41 (patch)
treecf6293250f6be73839bbe1691e08b6a1df507b4f /services/inputflinger/InputReader.cpp
parentaf126fb538c39d5488d62695b1bfb2990a3ef7db (diff)
downloadframeworks_native-12d6baa9b832f16a28f048ed5ffab75a76ed9c41.zip
frameworks_native-12d6baa9b832f16a28f048ed5ffab75a76ed9c41.tar.gz
frameworks_native-12d6baa9b832f16a28f048ed5ffab75a76ed9c41.tar.bz2
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
Diffstat (limited to 'services/inputflinger/InputReader.cpp')
-rw-r--r--services/inputflinger/InputReader.cpp9
1 files changed, 9 insertions, 0 deletions
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 @@ void TouchInputMapper::configure(nsecs_t when,
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 @@ void TouchInputMapper::dumpAffineTransformation(String8& dump) {
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());