From 12d6baa9b832f16a28f048ed5ffab75a76ed9c41 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Mon, 27 Jan 2014 18:34:20 -0800 Subject: 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 --- services/inputflinger/InputReader.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'services/inputflinger/InputReader.cpp') diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 9a4f84882a..a8ccf8bb0e 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()); -- cgit v1.2.3-59-g8ed1b