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: I81c76e8cf168728ee140abaf148e1cd31687d5af
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index 16972f6..69d8442 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -184,6 +184,7 @@
InputChannel fromChannel, InputChannel toChannel);
private static native void nativeSetPointerSpeed(long ptr, int speed);
private static native void nativeSetShowTouches(long ptr, boolean enabled);
+ private static native void nativeReloadCalibration(long ptr);
private static native void nativeVibrate(long ptr, int deviceId, long[] pattern,
int repeat, int token);
private static native void nativeCancelVibrate(long ptr, int deviceId, int token);
@@ -701,7 +702,7 @@
mTempFullKeyboards.clear();
}
- @Override // Binder call
+ @Override // Binder call & native callback
public TouchCalibration getTouchCalibrationForInputDevice(String inputDeviceDescriptor) {
if (inputDeviceDescriptor == null) {
throw new IllegalArgumentException("inputDeviceDescriptor must not be null");
@@ -728,7 +729,9 @@
synchronized (mDataStore) {
try {
- mDataStore.setTouchCalibration(inputDeviceDescriptor, calibration);
+ if (mDataStore.setTouchCalibration(inputDeviceDescriptor, calibration)) {
+ nativeReloadCalibration(mPtr);
+ }
} finally {
mDataStore.saveIfNeeded();
}