Add new fields to fingerprint PointerContext

The new fields provide additional information to the HAL about the touch
events originating from the framework.

Bug: 205915651
Test: m android.hardware.biometrics.common-update-api
Test: m android.hardware.biometrics.fingerprint-update-api
Test: lunch cf_x86_phone-userdebug && m
Change-Id: I987e26ac03e3268eea30feb9bbddffe6ca8d0035
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
index 3a6461e..9d1cb8f 100644
--- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
@@ -36,6 +36,6 @@
 parcelable OperationContext {
   int id = 0;
   android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN;
-  boolean isAoD = false;
+  boolean isAod = false;
   boolean isCrypto = false;
 }
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
index 390e698..72fe660 100644
--- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
@@ -41,8 +41,8 @@
      */
     OperationReason reason = OperationReason.UNKNOWN;
 
-    /* Flag indicating that the display is in AoD mode. */
-    boolean isAoD = false;
+    /* Flag indicating that the display is in AOD mode. */
+    boolean isAod = false;
 
     /** Flag indicating that crypto was requested. */
     boolean isCrypto = false;
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl
index e383330..43db6cf 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl
@@ -34,10 +34,13 @@
 package android.hardware.biometrics.fingerprint;
 @VintfStability
 parcelable PointerContext {
-  int pointerId = 0;
-  int x = 0;
-  int y = 0;
+  int pointerId = -1;
+  float x = 0.000000f;
+  float y = 0.000000f;
   float minor = 0.000000f;
   float major = 0.000000f;
-  boolean isAoD = false;
+  float orientation = 0.000000f;
+  boolean isAod = false;
+  long time = 0;
+  long gestureStart = 0;
 }
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl
index 4975175..e025d34 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl
@@ -21,14 +21,35 @@
  */
 @VintfStability
 parcelable PointerContext {
-    /* See android.view.MotionEvent#getPointerId. */
-    int pointerId = 0;
+    /**
+     * Pointer ID obtained from MotionEvent#getPointerId or -1 if the ID cannot be obtained, for
+     * example if this event originated from a low-level wake-up gesture.
+     *
+     * See android.view.MotionEvent#getPointerId.
+     */
+    int pointerId = -1;
 
-    /* The distance in pixels from the left edge of the display. */
-    int x = 0;
+    /**
+     * The distance in pixels from the left edge of the display.
+     *
+     * This is obtained from MotionEvent#getRawX and translated relative to Surface#ROTATION_0.
+     * Meaning, this value is always reported as if the device is in its natural (e.g. portrait)
+     * orientation.
+     *
+     * See android.view.MotionEvent#getRawX.
+     */
+    float x = 0f;
 
-    /* The distance in pixels from the top edge of the display. */
-    int y = 0;
+    /**
+     * The distance in pixels from the top edge of the display.
+     *
+     * This is obtained from MotionEvent#getRawY and translated relative to Surface#ROTATION_0.
+     * Meaning, this value is always reported as if the device is in its natural (e.g. portrait)
+     * orientation.
+     *
+     * See android.view.MotionEvent#getRawY.
+     */
+    float y = 0f;
 
     /* See android.view.MotionEvent#getTouchMinor. */
     float minor = 0f;
@@ -36,6 +57,32 @@
     /* See android.view.MotionEvent#getTouchMajor. */
     float major = 0f;
 
-    /* Flag indicating that the display is in AoD mode. */
-    boolean isAoD = false;
+    /* See android.view.MotionEvent#getOrientation. */
+    float orientation = 0f;
+
+    /* Flag indicating that the display is in AOD mode. */
+    boolean isAod = false;
+
+    /**
+     * The time of the user interaction that produced this event, in milliseconds.
+     *
+     * This is obtained from MotionEvent#getEventTime, which uses SystemClock.uptimeMillis() as
+     * the clock.
+     *
+     * See android.view.MotionEvent#getEventTime
+     */
+    long time = 0;
+
+    /**
+     * The time of the first user interaction in this gesture, in milliseconds.
+     *
+     * If this event is MotionEvent#ACTION_DOWN, it means it's the first event in this gesture,
+     * and `gestureStart` will be equal to `time`.
+     *
+     * This is obtained from MotionEvent#getDownTime, which uses SystemClock.uptimeMillis() as
+     * the clock.
+     *
+     * See android.view.MotionEvent#getDownTime
+     */
+    long gestureStart = 0;
 }