Fingerprint VTS

Bug: 34179855
Test:
  make vts;
  adb push
    out/host/linux-x86/vts/android-vts/testcases/DATA/nativetest64/fingerprint_hidl_hal_test/fingerprint_hidl_hal_test
    /data/local/tmp/.;
  adb shell /data/local/tmp/fingerprint_hidl_hal_test;

Change-Id: If9174dc34d0802388a9af8cda88b28329248bc42
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
index 7f0d005..b106481 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
index 652a3e0..5923c84 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/biometrics/fingerprint/2.1/default/service.cpp b/biometrics/fingerprint/2.1/default/service.cpp
index 0563acb..d6b91c6 100644
--- a/biometrics/fingerprint/2.1/default/service.cpp
+++ b/biometrics/fingerprint/2.1/default/service.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2017 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/biometrics/fingerprint/2.1/types.hal b/biometrics/fingerprint/2.1/types.hal
index f462906..e389773 100644
--- a/biometrics/fingerprint/2.1/types.hal
+++ b/biometrics/fingerprint/2.1/types.hal
@@ -49,6 +49,8 @@
  * followed by ERROR_CANCELED.
  */
 enum FingerprintError : int32_t {
+  /* Used for testing, no error returned */
+  ERROR_NO_ERROR = 0,
   /* The hardware has an error that can't be resolved. */
   ERROR_HW_UNAVAILABLE = 1,
   /* Bad data; operation can't continue */
diff --git a/biometrics/fingerprint/2.1/vts/BiometricsFingerprint.vts b/biometrics/fingerprint/2.1/vts/BiometricsFingerprint.vts
new file mode 100644
index 0000000..475333e
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/BiometricsFingerprint.vts
@@ -0,0 +1,461 @@
+component_class: HAL_HIDL
+component_type_version: 2.1
+component_name: "IBiometricsFingerprint"
+
+package: "android.hardware.biometrics.fingerprint"
+
+import: "android.hardware.biometrics.fingerprint@2.1::IBiometricsFingerprintClientCallback"
+import: "android.hardware.biometrics.fingerprint@2.1::types"
+import: "android.hidl.base@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "SYS_UNKNOWN"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "SYS_OK"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "SYS_ENOENT"
+            scalar_value: {
+                int32_t: -2
+            }
+            enumerator: "SYS_EINTR"
+            scalar_value: {
+                int32_t: -4
+            }
+            enumerator: "SYS_EIO"
+            scalar_value: {
+                int32_t: -5
+            }
+            enumerator: "SYS_EAGAIN"
+            scalar_value: {
+                int32_t: -11
+            }
+            enumerator: "SYS_ENOMEM"
+            scalar_value: {
+                int32_t: -12
+            }
+            enumerator: "SYS_EACCES"
+            scalar_value: {
+                int32_t: -13
+            }
+            enumerator: "SYS_EFAULT"
+            scalar_value: {
+                int32_t: -14
+            }
+            enumerator: "SYS_EBUSY"
+            scalar_value: {
+                int32_t: -16
+            }
+            enumerator: "SYS_EINVAL"
+            scalar_value: {
+                int32_t: -22
+            }
+            enumerator: "SYS_ENOSPC"
+            scalar_value: {
+                int32_t: -28
+            }
+            enumerator: "SYS_ETIMEDOUT"
+            scalar_value: {
+                int32_t: -110
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR_NO_ERROR"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ERROR_HW_UNAVAILABLE"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ERROR_UNABLE_TO_PROCESS"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ERROR_TIMEOUT"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ERROR_NO_SPACE"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ERROR_CANCELED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ERROR_UNABLE_TO_REMOVE"
+            scalar_value: {
+                int32_t: 6
+            }
+            enumerator: "ERROR_LOCKOUT"
+            scalar_value: {
+                int32_t: 7
+            }
+            enumerator: "ERROR_VENDOR"
+            scalar_value: {
+                int32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ACQUIRED_GOOD"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ACQUIRED_PARTIAL"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ACQUIRED_INSUFFICIENT"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ACQUIRED_IMAGER_DIRTY"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ACQUIRED_TOO_SLOW"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ACQUIRED_TOO_FAST"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ACQUIRED_VENDOR"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "gid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "fid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintEnroll"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "samplesRemaining"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "msg"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintIterator"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "remainingTemplates"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquired"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "acquiredInfo"
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAuthenticated"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "hat"
+            type: TYPE_ARRAY
+            vector_size: 69
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintMsgType"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR"
+            scalar_value: {
+                int32_t: -1
+            }
+            enumerator: "ACQUIRED"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "TEMPLATE_ENROLLING"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "TEMPLATE_REMOVED"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "AUTHENTICATED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "TEMPLATE_ENUMERATING"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hidl::base::V1_0::DebugInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "pid"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "ptr"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "setNotify"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_HIDL_CALLBACK
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback"
+        }
+        callflow: {
+            next: "setActiveGroup"
+        }
+        callflow: {
+            entry: true
+        }
+    }
+
+    api: {
+        name: "preEnroll"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            next: "enroll"
+            next: "postEnroll"
+        }
+    }
+
+    api: {
+        name: "enroll"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_ARRAY
+            vector_size: 69
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "cancel"
+            next: "enroll"
+            next: "postEnroll"
+            next: "remove"
+        }
+    }
+
+    api: {
+        name: "postEnroll"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        callflow: {
+            next: "authenticate"
+            next: "setActiveGroup"
+            next: "enumerate"
+            next: "remove"
+        }
+    }
+
+    api: {
+        name: "getAuthenticatorId"
+        return_type_hidl: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        callflow: {
+            next: "authenticate"
+        }
+    }
+
+    api: {
+        name: "cancel"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        callflow: {
+            next: "authenticate"
+            next: "enroll"
+            next: "enumerate"
+            next: "remove"
+            next: "setActiveGroup"
+        }
+    }
+
+    api: {
+        name: "enumerate"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        callflow: {
+            next: "remove"
+            next: "enroll"
+            next: "authenticate"
+            next: "setActiveGroup"
+        }
+    }
+
+    api: {
+        name: "remove"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "enumerate"
+            next: "authenticate"
+            next: "cancel"
+            next: "getAuthenticatorId"
+            next: "setActiveGroup"
+        }
+    }
+
+    api: {
+        name: "setActiveGroup"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_STRING
+        }
+        callflow: {
+            next: "authenticate"
+            next: "preEnroll"
+            next: "enumerate"
+            next: "remove"
+        }
+    }
+
+    api: {
+        name: "authenticate"
+        return_type_hidl: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        callflow: {
+            next: "cancel"
+            next: "preEnroll"
+            next: "remove"
+        }
+    }
+
+}
diff --git a/biometrics/fingerprint/2.1/vts/BiometricsFingerprintClientCallback.vts b/biometrics/fingerprint/2.1/vts/BiometricsFingerprintClientCallback.vts
new file mode 100644
index 0000000..7cf4003
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/BiometricsFingerprintClientCallback.vts
@@ -0,0 +1,396 @@
+component_class: HAL_HIDL
+component_type_version: 2.1
+component_name: "IBiometricsFingerprintClientCallback"
+
+package: "android.hardware.biometrics.fingerprint"
+
+import: "android.hardware.biometrics.fingerprint@2.1::types"
+import: "android.hidl.base@1.0::types"
+
+interface: {
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "SYS_UNKNOWN"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "SYS_OK"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "SYS_ENOENT"
+            scalar_value: {
+                int32_t: -2
+            }
+            enumerator: "SYS_EINTR"
+            scalar_value: {
+                int32_t: -4
+            }
+            enumerator: "SYS_EIO"
+            scalar_value: {
+                int32_t: -5
+            }
+            enumerator: "SYS_EAGAIN"
+            scalar_value: {
+                int32_t: -11
+            }
+            enumerator: "SYS_ENOMEM"
+            scalar_value: {
+                int32_t: -12
+            }
+            enumerator: "SYS_EACCES"
+            scalar_value: {
+                int32_t: -13
+            }
+            enumerator: "SYS_EFAULT"
+            scalar_value: {
+                int32_t: -14
+            }
+            enumerator: "SYS_EBUSY"
+            scalar_value: {
+                int32_t: -16
+            }
+            enumerator: "SYS_EINVAL"
+            scalar_value: {
+                int32_t: -22
+            }
+            enumerator: "SYS_ENOSPC"
+            scalar_value: {
+                int32_t: -28
+            }
+            enumerator: "SYS_ETIMEDOUT"
+            scalar_value: {
+                int32_t: -110
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR_NO_ERROR"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ERROR_HW_UNAVAILABLE"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ERROR_UNABLE_TO_PROCESS"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ERROR_TIMEOUT"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ERROR_NO_SPACE"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ERROR_CANCELED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ERROR_UNABLE_TO_REMOVE"
+            scalar_value: {
+                int32_t: 6
+            }
+            enumerator: "ERROR_LOCKOUT"
+            scalar_value: {
+                int32_t: 7
+            }
+            enumerator: "ERROR_VENDOR"
+            scalar_value: {
+                int32_t: 8
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ACQUIRED_GOOD"
+            scalar_value: {
+                int32_t: 0
+            }
+            enumerator: "ACQUIRED_PARTIAL"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "ACQUIRED_INSUFFICIENT"
+            scalar_value: {
+                int32_t: 2
+            }
+            enumerator: "ACQUIRED_IMAGER_DIRTY"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "ACQUIRED_TOO_SLOW"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "ACQUIRED_TOO_FAST"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "ACQUIRED_VENDOR"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "gid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "fid"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintEnroll"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "samplesRemaining"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        struct_value: {
+            name: "msg"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintIterator"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "remainingTemplates"
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquired"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "acquiredInfo"
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAuthenticated"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "finger"
+            type: TYPE_STRUCT
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+        }
+        struct_value: {
+            name: "hat"
+            type: TYPE_ARRAY
+            vector_size: 69
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintMsgType"
+        type: TYPE_ENUM
+        enum_value: {
+            scalar_type: "int32_t"
+
+            enumerator: "ERROR"
+            scalar_value: {
+                int32_t: -1
+            }
+            enumerator: "ACQUIRED"
+            scalar_value: {
+                int32_t: 1
+            }
+            enumerator: "TEMPLATE_ENROLLING"
+            scalar_value: {
+                int32_t: 3
+            }
+            enumerator: "TEMPLATE_REMOVED"
+            scalar_value: {
+                int32_t: 4
+            }
+            enumerator: "AUTHENTICATED"
+            scalar_value: {
+                int32_t: 5
+            }
+            enumerator: "TEMPLATE_ENUMERATING"
+            scalar_value: {
+                int32_t: 6
+            }
+        }
+    }
+
+    attribute: {
+        name: "::android::hidl::base::V1_0::DebugInfo"
+        type: TYPE_STRUCT
+        struct_value: {
+            name: "pid"
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+        struct_value: {
+            name: "ptr"
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+    }
+
+    api: {
+        name: "onEnrollResult"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onAcquired"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "onAuthenticated"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_VECTOR
+            vector_value: {
+                type: TYPE_SCALAR
+                scalar_type: "uint8_t"
+            }
+        }
+    }
+
+    api: {
+        name: "onError"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_ENUM
+            predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "int32_t"
+        }
+    }
+
+    api: {
+        name: "onRemoved"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+    api: {
+        name: "onEnumerate"
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint64_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+        arg: {
+            type: TYPE_SCALAR
+            scalar_type: "uint32_t"
+        }
+    }
+
+}
diff --git a/biometrics/fingerprint/2.1/vts/functional/Android.bp b/biometrics/fingerprint/2.1/vts/functional/Android.bp
new file mode 100644
index 0000000..7d2e83f
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/functional/Android.bp
@@ -0,0 +1,41 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+    name: "fingerprint_hidl_hal_test",
+    gtest: true,
+    srcs: ["fingerprint_hidl_hal_test.cpp"],
+    shared_libs: [
+        "libbase",
+        "libhidltransport",
+        "libhardware",
+        "libhwbinder",
+        "libhidlbase",
+        "liblog",
+        "libutils",
+        "android.hardware.biometrics.fingerprint@2.1",
+    ],
+    static_libs: ["libgtest"],
+    cflags: [
+        "--coverage",
+        "-O0",
+        "-g",
+    ],
+    ldflags: [
+        "--coverage"
+    ]
+}
+
diff --git a/biometrics/fingerprint/2.1/vts/functional/fingerprint_hidl_hal_test.cpp b/biometrics/fingerprint/2.1/vts/functional/fingerprint_hidl_hal_test.cpp
new file mode 100644
index 0000000..9138000
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/functional/fingerprint_hidl_hal_test.cpp
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "fingerprint_hidl_hal_test"
+
+#include <android-base/logging.h>
+#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
+#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.h>
+#include <chrono>
+#include <gtest/gtest.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+
+using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
+using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
+using android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo;
+using android::hardware::biometrics::fingerprint::V2_1::FingerprintError;
+using android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
+using android::hardware::hidl_vec;
+using android::hardware::Return;
+
+#define SERVICE_NAME "fingerprint_hal"
+
+class FingerprintHidlTest : public ::testing::Test,
+    public IBiometricsFingerprintClientCallback {
+
+protected:
+    android::sp<IBiometricsFingerprint> service;
+    FingerprintError err;
+    // State changes should occur within this threshold, otherwise the
+    // framework' will assume things have broken.
+    std::chrono::seconds threshold;
+
+public:
+    FingerprintHidlTest ():
+        err(FingerprintError::ERROR_NO_ERROR), threshold(1) {}
+
+    virtual void SetUp() override {
+        service = IBiometricsFingerprint::getService(SERVICE_NAME);
+
+        ASSERT_NE(service, nullptr);
+        clearErr();
+
+        // TODO: instantly fail any test that receives a death notification
+    }
+
+    virtual void TearDown() override {}
+
+    // implement methods of IBiometricsFingerprintClientCallback
+    virtual Return<void> onEnrollResult(uint64_t, uint32_t, uint32_t, uint32_t)
+            override {
+        return Return<void>();
+    }
+    virtual Return<void> onAcquired(uint64_t, FingerprintAcquiredInfo, int32_t)
+            override {
+        return Return<void>();
+    }
+
+    virtual Return<void> onAuthenticated(uint64_t, uint32_t, uint32_t, const
+            hidl_vec<uint8_t>&) override {
+        return Return<void>();
+    }
+
+    virtual Return<void> onError(uint64_t, FingerprintError error, int32_t)
+            override {
+        err = error;
+        return Return<void>();
+    }
+
+    virtual Return<void> onRemoved(uint64_t, uint32_t, uint32_t, uint32_t)
+            override {
+        return Return<void>();
+    }
+
+    virtual Return<void> onEnumerate(uint64_t, uint32_t, uint32_t, uint32_t)
+            override {
+        return Return<void>();
+    }
+
+    void clearErr () {
+        err = FingerprintError::ERROR_NO_ERROR;
+    }
+};
+
+class FingerprintHidlEnvironment : public ::testing::Environment {
+public:
+    virtual void SetUp() {}
+    virtual void TearDown() {}
+};
+
+// The service should be reachable.
+TEST_F(FingerprintHidlTest, ConnectTest) {
+    Return<uint64_t> rc = service->setNotify(this);
+    EXPECT_NE(rc, 0UL);
+}
+
+// Cancel should always return ERROR_CANCELED from any starting state including
+// the IDLE state.
+TEST_F(FingerprintHidlTest, CancelTest) {
+    Return<uint64_t> rc = service->setNotify(this);
+    EXPECT_NE(rc, 0UL);
+
+    auto start = std::chrono::system_clock::now();
+    Return<RequestStatus> res = service->cancel();
+    auto end = std::chrono::system_clock::now();
+    auto diff = end - start;
+
+    // check that we were able to make an IPC request successfully
+    EXPECT_EQ(RequestStatus::SYS_OK, res);
+    // check error should be ERROR_CANCELED
+    EXPECT_EQ(FingerprintError::ERROR_CANCELED, err);
+    // check that this did not take longer than a threshold
+    EXPECT_TRUE(diff <= threshold);
+}
+
+// A call to cancel should after any other method call should set the error
+// state to canceled.
+TEST_F(FingerprintHidlTest, AuthTest) {
+    Return<uint64_t> rc = service->setNotify(this);
+    EXPECT_NE(rc, 0UL);
+
+    Return<RequestStatus> res = service->authenticate(0, 0);
+    // check that we were able to make an IPC request successfully
+    EXPECT_EQ(RequestStatus::SYS_OK, res);
+
+    auto start = std::chrono::system_clock::now();
+    res = service->cancel();
+    auto end = std::chrono::system_clock::now();
+    auto diff = end - start;
+
+    // check that we were able to make an IPC request successfully
+    EXPECT_EQ(RequestStatus::SYS_OK, res);
+    // check error should be ERROR_CANCELED
+    EXPECT_EQ(FingerprintError::ERROR_CANCELED, err);
+    // check that this did not take longer than a threshold
+    EXPECT_TRUE(diff <= threshold);
+}
+
+int main(int argc, char **argv) {
+    ::testing::AddGlobalTestEnvironment(new FingerprintHidlEnvironment);
+    ::testing::InitGoogleTest(&argc, argv);
+    int status = RUN_ALL_TESTS();
+    LOG(INFO) << "Test result = " << status;
+    return status;
+}
diff --git a/biometrics/fingerprint/2.1/vts/types.vts b/biometrics/fingerprint/2.1/vts/types.vts
new file mode 100644
index 0000000..9f9fd37
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/types.vts
@@ -0,0 +1,262 @@
+component_class: HAL_HIDL
+component_type_version: 2.1
+component_name: "types"
+
+package: "android.hardware.biometrics.fingerprint"
+
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::RequestStatus"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "SYS_UNKNOWN"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "SYS_OK"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "SYS_ENOENT"
+        scalar_value: {
+            int32_t: -2
+        }
+        enumerator: "SYS_EINTR"
+        scalar_value: {
+            int32_t: -4
+        }
+        enumerator: "SYS_EIO"
+        scalar_value: {
+            int32_t: -5
+        }
+        enumerator: "SYS_EAGAIN"
+        scalar_value: {
+            int32_t: -11
+        }
+        enumerator: "SYS_ENOMEM"
+        scalar_value: {
+            int32_t: -12
+        }
+        enumerator: "SYS_EACCES"
+        scalar_value: {
+            int32_t: -13
+        }
+        enumerator: "SYS_EFAULT"
+        scalar_value: {
+            int32_t: -14
+        }
+        enumerator: "SYS_EBUSY"
+        scalar_value: {
+            int32_t: -16
+        }
+        enumerator: "SYS_EINVAL"
+        scalar_value: {
+            int32_t: -22
+        }
+        enumerator: "SYS_ENOSPC"
+        scalar_value: {
+            int32_t: -28
+        }
+        enumerator: "SYS_ETIMEDOUT"
+        scalar_value: {
+            int32_t: -110
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintError"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ERROR_NO_ERROR"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ERROR_HW_UNAVAILABLE"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ERROR_UNABLE_TO_PROCESS"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ERROR_TIMEOUT"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ERROR_NO_SPACE"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ERROR_CANCELED"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "ERROR_UNABLE_TO_REMOVE"
+        scalar_value: {
+            int32_t: 6
+        }
+        enumerator: "ERROR_LOCKOUT"
+        scalar_value: {
+            int32_t: 7
+        }
+        enumerator: "ERROR_VENDOR"
+        scalar_value: {
+            int32_t: 8
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ACQUIRED_GOOD"
+        scalar_value: {
+            int32_t: 0
+        }
+        enumerator: "ACQUIRED_PARTIAL"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "ACQUIRED_INSUFFICIENT"
+        scalar_value: {
+            int32_t: 2
+        }
+        enumerator: "ACQUIRED_IMAGER_DIRTY"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "ACQUIRED_TOO_SLOW"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "ACQUIRED_TOO_FAST"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "ACQUIRED_VENDOR"
+        scalar_value: {
+            int32_t: 6
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "gid"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "fid"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintEnroll"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "finger"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    }
+    struct_value: {
+        name: "samplesRemaining"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+    struct_value: {
+        name: "msg"
+        type: TYPE_SCALAR
+        scalar_type: "uint64_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintIterator"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "finger"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    }
+    struct_value: {
+        name: "remainingTemplates"
+        type: TYPE_SCALAR
+        scalar_type: "uint32_t"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquired"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "acquiredInfo"
+        type: TYPE_ENUM
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo"
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintAuthenticated"
+    type: TYPE_STRUCT
+    struct_value: {
+        name: "finger"
+        type: TYPE_STRUCT
+        predefined_type: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintFingerId"
+    }
+    struct_value: {
+        name: "hat"
+        type: TYPE_ARRAY
+        vector_size: 69
+        vector_value: {
+            type: TYPE_SCALAR
+            scalar_type: "uint8_t"
+        }
+    }
+}
+
+attribute: {
+    name: "::android::hardware::biometrics::fingerprint::V2_1::FingerprintMsgType"
+    type: TYPE_ENUM
+    enum_value: {
+        scalar_type: "int32_t"
+
+        enumerator: "ERROR"
+        scalar_value: {
+            int32_t: -1
+        }
+        enumerator: "ACQUIRED"
+        scalar_value: {
+            int32_t: 1
+        }
+        enumerator: "TEMPLATE_ENROLLING"
+        scalar_value: {
+            int32_t: 3
+        }
+        enumerator: "TEMPLATE_REMOVED"
+        scalar_value: {
+            int32_t: 4
+        }
+        enumerator: "AUTHENTICATED"
+        scalar_value: {
+            int32_t: 5
+        }
+        enumerator: "TEMPLATE_ENUMERATING"
+        scalar_value: {
+            int32_t: 6
+        }
+    }
+}
+