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
This commit is contained in:
Ilya Matyukhin
2022-02-07 15:40:21 -08:00
parent 7b7e4616c3
commit f6e0f39cde
4 changed files with 65 additions and 15 deletions

View File

@@ -36,6 +36,6 @@ package android.hardware.biometrics.common;
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;
}

View File

@@ -41,8 +41,8 @@ parcelable OperationContext {
*/
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;

View File

@@ -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;
}

View File

@@ -21,14 +21,35 @@ package android.hardware.biometrics.fingerprint;
*/
@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 @@ parcelable PointerContext {
/* 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;
}