Support unique calibration per orientation

Updates the format of the calibration XML to store the Surface rotation
that a specific calibration applies to. Also updates the API to require
a rotation value for get/set, and has the native framework supply this
according to the current rotation whenever it changes.

Change-Id: If38563ceba27c9d8a75f9fd7928c8d7c9d187afb
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index a8ccf8b..05b1a9c 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -3282,6 +3282,9 @@
             break;
         }
 
+        // Location
+        updateAffineTransformation();
+
         if (mDeviceMode == DEVICE_MODE_POINTER) {
             // Compute pointer gesture detection parameters.
             float rawDiagonal = hypotf(rawWidth, rawHeight);
@@ -3660,7 +3663,8 @@
 }
 
 void TouchInputMapper::updateAffineTransformation() {
-    mAffineTransform = getPolicy()->getTouchAffineTransformation(mDevice->getDescriptor());
+    mAffineTransform = getPolicy()->getTouchAffineTransformation(mDevice->getDescriptor(),
+            mSurfaceOrientation);
 }
 
 void TouchInputMapper::reset(nsecs_t when) {