Bind Fingerprint Virutal HAL with IVirtual interface
Bug: 326227403
Test: atest CtsBiometricsTestCases -c
Ignore-AOSP-First: CLs of other related projects needs this CL to run
presubmit tests
Change-Id: I295925d7c26235dc66c7c9481d08661095c8dc92
diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp
index 9b72c87..faaa9c6 100644
--- a/biometrics/fingerprint/aidl/default/Android.bp
+++ b/biometrics/fingerprint/aidl/default/Android.bp
@@ -8,10 +8,9 @@
default_applicable_licenses: ["hardware_interfaces_license"],
}
-cc_binary {
- name: "android.hardware.biometrics.fingerprint-service.example",
- vendor: true,
- relative_install_path: "hw",
+cc_library_static {
+ name: "android.hardware.biometrics.fingerprint-service.lib",
+ vendor_available: true,
local_include_dirs: ["include"],
srcs: [
"FakeLockoutTracker.cpp",
@@ -30,22 +29,80 @@
"libbinder_ndk",
"liblog",
],
- static_libs: [
+ whole_static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
"libbase",
- "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.fingerprint.virtualhal-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.biometrics.common.thread",
"android.hardware.biometrics.common.util",
"android.hardware.biometrics.common.config",
"android.hardware.keymaster-V4-ndk",
],
+ product_variables: {
+ debuggable: {
+ cflags: ["-DFPS_DEBUGGABLE"],
+ },
+ },
+ apex_available: [
+ "com.android.hardware.biometrics.fingerprint.virtual",
+ "//apex_available:platform",
+ ],
+}
+
+cc_binary {
+ name: "android.hardware.biometrics.fingerprint-service.example",
+ system_ext_specific: true,
+ relative_install_path: "hw",
+ local_include_dirs: ["include"],
+ srcs: [
+ ],
+ stl: "c++_static",
+ shared_libs: [
+ "libbinder_ndk",
+ "liblog",
+ ],
+ whole_static_libs: [
+ "android.hardware.biometrics.fingerprint-service.lib",
+ ],
installable: false, // install APEX instead
product_variables: {
debuggable: {
cflags: ["-DFPS_DEBUGGABLE"],
},
},
+ apex_available: [
+ "com.android.hardware.biometrics.fingerprint.virtual",
+ ],
+}
+
+cc_binary {
+ name: "android.hardware.biometrics.fingerprint-service.default",
+ //system_ext_specific: true,
+ vendor: true,
+ relative_install_path: "hw",
+ init_rc: ["fingerprint-default.rc"],
+ vintf_fragments: ["fingerprint-default.xml"],
+ local_include_dirs: ["include"],
+ srcs: [
+ ],
+ stl: "c++_static",
+ shared_libs: [
+ "libbinder_ndk",
+ "liblog",
+ ],
+ whole_static_libs: [
+ "android.hardware.biometrics.fingerprint-service.lib",
+ ],
+ product_variables: {
+ debuggable: {
+ cflags: ["-DFPS_DEBUGGABLE"],
+ },
+ },
+ apex_available: [
+ "//apex_available:platform",
+ ],
}
cc_test {
@@ -63,14 +120,13 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
"android.hardware.biometrics.common.config",
"android.hardware.biometrics.common.thread",
],
- vendor: true,
test_suites: ["general-tests"],
require_root: true,
}
@@ -91,14 +147,13 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
"android.hardware.biometrics.common.config",
"android.hardware.biometrics.common.thread",
],
- vendor: true,
test_suites: ["general-tests"],
require_root: true,
}
@@ -117,14 +172,13 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
"android.hardware.biometrics.common.thread",
"android.hardware.biometrics.common.config",
],
- vendor: true,
test_suites: ["general-tests"],
require_root: true,
}
@@ -145,14 +199,13 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
"android.hardware.biometrics.common.thread",
"android.hardware.biometrics.common.config",
],
- vendor: true,
test_suites: ["general-tests"],
require_root: true,
}
@@ -178,7 +231,8 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V5-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.fingerprint.virtualhal-ndk",
"android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
@@ -190,7 +244,6 @@
cflags: ["-DFPS_DEBUGGABLE"],
},
},
- vendor: true,
test_suites: ["general-tests"],
require_root: true,
}
@@ -198,39 +251,34 @@
sysprop_library {
name: "android.hardware.biometrics.fingerprint.VirtualProps",
srcs: ["fingerprint.sysprop"],
- property_owner: "Vendor",
- vendor: true,
+ property_owner: "Platform",
+ vendor_available: true,
+ apex_available: [
+ "com.android.hardware.biometrics.fingerprint.virtual",
+ "//apex_available:platform",
+ ],
}
prebuilt_etc {
- name: "fingerprint-example.rc",
- src: "fingerprint-example.rc",
- installable: false,
-}
-
-prebuilt_etc {
- name: "fingerprint-example.xml",
- src: "fingerprint-example.xml",
- sub_dir: "vintf",
+ name: "fingerprint-virtual.rc",
+ src: "fingerprint-virtual.rc",
installable: false,
}
apex {
name: "com.android.hardware.biometrics.fingerprint.virtual",
manifest: "apex_manifest.json",
- file_contexts: "apex_file_contexts",
+ file_contexts: ":com.android.biometrics.virtual.fingerprint-file_contexts",
key: "com.android.hardware.key",
certificate: ":com.android.hardware.certificate",
updatable: false,
- vendor: true,
+ system_ext_specific: true,
binaries: [
"android.hardware.biometrics.fingerprint-service.example",
],
prebuilts: [
// init_rc
- "fingerprint-example.rc",
- // vintf_fragment
- "fingerprint-example.xml",
+ "fingerprint-virtual.rc",
],
}
diff --git a/biometrics/fingerprint/aidl/default/VirtualHal.cpp b/biometrics/fingerprint/aidl/default/VirtualHal.cpp
index e107d2f..d161765 100644
--- a/biometrics/fingerprint/aidl/default/VirtualHal.cpp
+++ b/biometrics/fingerprint/aidl/default/VirtualHal.cpp
@@ -26,7 +26,7 @@
#define LOG_TAG "FingerprintVirtualHalAidl"
namespace aidl::android::hardware::biometrics::fingerprint {
-
+using AcquiredInfoAndVendorCode = virtualhal::AcquiredInfoAndVendorCode;
using Tag = AcquiredInfoAndVendorCode::Tag;
::ndk::ScopedAStatus VirtualHal::setEnrollments(const std::vector<int32_t>& enrollments) {
@@ -41,8 +41,7 @@
return ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus VirtualHal::setNextEnrollment(
- const ::aidl::android::hardware::biometrics::fingerprint::NextEnrollment& next_enrollment) {
+::ndk::ScopedAStatus VirtualHal::setNextEnrollment(const NextEnrollment& next_enrollment) {
Fingerprint::cfg().sourcedFromAidl();
std::ostringstream os;
os << next_enrollment.id << ":";
@@ -333,4 +332,10 @@
return ndk::ScopedAStatus::ok();
}
+::ndk::ScopedAStatus VirtualHal::getFingerprintHal(
+ std::shared_ptr<::aidl::android::hardware::biometrics::fingerprint::IFingerprint>* pFp) {
+ LOG(INFO) << " calling getFingerprintHal in VirtualHal.cpp";
+ *pFp = mFp;
+ return ndk::ScopedAStatus::ok();
+}
} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/api/android.hardware.biometrics.fingerprint.VirtualProps-current.txt b/biometrics/fingerprint/aidl/default/api/android.hardware.biometrics.fingerprint.VirtualProps-current.txt
index e69de29..8c02a68 100644
--- a/biometrics/fingerprint/aidl/default/api/android.hardware.biometrics.fingerprint.VirtualProps-current.txt
+++ b/biometrics/fingerprint/aidl/default/api/android.hardware.biometrics.fingerprint.VirtualProps-current.txt
@@ -0,0 +1,178 @@
+props {
+ owner: Vendor
+ module: "android.fingerprint.virt.FingerprintHalProperties"
+ prop {
+ api_name: "authenticator_id"
+ type: Long
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.authenticator_id"
+ }
+ prop {
+ api_name: "challenge"
+ type: Long
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.challenge"
+ }
+ prop {
+ api_name: "control_illumination"
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.udfps.control_illumination"
+ }
+ prop {
+ api_name: "detect_interaction"
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.detect_interaction"
+ }
+ prop {
+ api_name: "display_touch"
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.udfps.display_touch"
+ }
+ prop {
+ api_name: "enrollment_hit"
+ type: Integer
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.enrollment_hit"
+ }
+ prop {
+ api_name: "enrollments"
+ type: IntegerList
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.enrollments"
+ }
+ prop {
+ api_name: "lockout"
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.lockout"
+ }
+ prop {
+ api_name: "lockout_enable"
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.lockout_enable"
+ }
+ prop {
+ api_name: "lockout_permanent_threshold"
+ type: Integer
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.lockout_permanent_threshold"
+ }
+ prop {
+ api_name: "lockout_timed_duration"
+ type: Integer
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.lockout_timed_duration"
+ }
+ prop {
+ api_name: "lockout_timed_threshold"
+ type: Integer
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.lockout_timed_threshold"
+ }
+ prop {
+ api_name: "max_enrollments"
+ type: Integer
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.max_enrollments"
+ }
+ prop {
+ api_name: "navigation_guesture"
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.navigation_guesture"
+ }
+ prop {
+ api_name: "next_enrollment"
+ type: String
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.next_enrollment"
+ }
+ prop {
+ api_name: "operation_authenticate_acquired"
+ type: String
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_authenticate_acquired"
+ }
+ prop {
+ api_name: "operation_authenticate_duration"
+ type: Integer
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_authenticate_duration"
+ }
+ prop {
+ api_name: "operation_authenticate_error"
+ type: Integer
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_authenticate_error"
+ }
+ prop {
+ api_name: "operation_authenticate_fails"
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_authenticate_fails"
+ }
+ prop {
+ api_name: "operation_authenticate_latency"
+ type: IntegerList
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_authenticate_latency"
+ }
+ prop {
+ api_name: "operation_detect_interaction_acquired"
+ type: String
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_acquired"
+ }
+ prop {
+ api_name: "operation_detect_interaction_duration"
+ type: Integer
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_duration"
+ }
+ prop {
+ api_name: "operation_detect_interaction_error"
+ type: Integer
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_error"
+ }
+ prop {
+ api_name: "operation_detect_interaction_latency"
+ type: IntegerList
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_latency"
+ }
+ prop {
+ api_name: "operation_enroll_error"
+ type: Integer
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_enroll_error"
+ }
+ prop {
+ api_name: "operation_enroll_latency"
+ type: IntegerList
+ access: ReadWrite
+ prop_name: "vendor.fingerprint.virtual.operation_enroll_latency"
+ }
+ prop {
+ api_name: "sensor_id"
+ type: Integer
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.sensor_id"
+ }
+ prop {
+ api_name: "sensor_location"
+ type: String
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.sensor_location"
+ }
+ prop {
+ api_name: "sensor_strength"
+ type: Integer
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.sensor_strength"
+ }
+ prop {
+ api_name: "type"
+ type: String
+ access: ReadWrite
+ prop_name: "persist.vendor.fingerprint.virtual.type"
+ enum_values: "default|rear|udfps|side"
+ }
+}
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-default.rc b/biometrics/fingerprint/aidl/default/fingerprint-default.rc
new file mode 100644
index 0000000..7e46bc1
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/fingerprint-default.rc
@@ -0,0 +1,7 @@
+service vendor.fingerprint-default /vendor/bin/hw/android.hardware.biometrics.fingerprint-service.default default
+ class hal
+ user nobody
+ group nobody
+ interface aidl android.hardware.biometrics.fingerprint.IFingerprint/default
+ oneshot
+ disabled
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-default.xml b/biometrics/fingerprint/aidl/default/fingerprint-default.xml
new file mode 100644
index 0000000..d140459
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/fingerprint-default.xml
@@ -0,0 +1,10 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <version>4</version>
+ <interface>
+ <name>IFingerprint</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-example.rc b/biometrics/fingerprint/aidl/default/fingerprint-example.rc
deleted file mode 100644
index da4ea45..0000000
--- a/biometrics/fingerprint/aidl/default/fingerprint-example.rc
+++ /dev/null
@@ -1,7 +0,0 @@
-service vendor.fingerprint-example /apex/com.android.hardware.biometrics.fingerprint.virtual/bin/hw/android.hardware.biometrics.fingerprint-service.example
- class hal
- user nobody
- group nobody
- interface aidl android.hardware.biometrics.fingerprint.IFingerprint/virtual
- oneshot
- disabled
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-example.xml b/biometrics/fingerprint/aidl/default/fingerprint-example.xml
deleted file mode 100644
index ee529e9..0000000
--- a/biometrics/fingerprint/aidl/default/fingerprint-example.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<manifest version="1.0" type="device">
- <hal format="aidl">
- <name>android.hardware.biometrics.fingerprint</name>
- <version>5</version>
- <fqname>IFingerprint/virtual</fqname>
- </hal>
-</manifest>
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-virtual.rc b/biometrics/fingerprint/aidl/default/fingerprint-virtual.rc
new file mode 100644
index 0000000..5d1506c
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/fingerprint-virtual.rc
@@ -0,0 +1,7 @@
+service fingerprint-virtual /apex/com.android.hardware.biometrics.fingerprint.virtual/bin/hw/android.hardware.biometrics.fingerprint-service.example virtual
+ class hal
+ user nobody
+ group nobody
+ interface aidl android.hardware.biometrics.fingerprint.virtualhal.IVirtualHal/virtual
+ oneshot
+ disabled
diff --git a/biometrics/fingerprint/aidl/default/fingerprint.sysprop b/biometrics/fingerprint/aidl/default/fingerprint.sysprop
index 6a6c297..eb33432 100644
--- a/biometrics/fingerprint/aidl/default/fingerprint.sysprop
+++ b/biometrics/fingerprint/aidl/default/fingerprint.sysprop
@@ -7,7 +7,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.type"
type: String
- scope: Internal
+ scope: Public
access: ReadWrite
enum_values: "default|rear|udfps|side"
api_name: "type"
@@ -17,7 +17,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.enrollments"
type: IntegerList
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "enrollments"
}
@@ -27,7 +27,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.enrollment_hit"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "enrollment_hit"
}
@@ -42,7 +42,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.next_enrollment"
type: String
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "next_enrollment"
}
@@ -51,7 +51,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.authenticator_id"
type: Long
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "authenticator_id"
}
@@ -60,7 +60,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.challenge"
type: Long
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "challenge"
}
@@ -69,7 +69,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_authenticate_fails"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_authenticate_fails"
}
@@ -82,7 +82,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_error"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_detect_interaction_error"
}
@@ -91,7 +91,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_enroll_error"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_enroll_error"
}
@@ -104,7 +104,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_authenticate_latency"
type: IntegerList
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_authenticate_latency"
}
@@ -114,7 +114,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_latency"
type: IntegerList
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_detect_interaction_latency"
}
@@ -124,7 +124,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_enroll_latency"
type: IntegerList
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_enroll_latency"
}
@@ -134,7 +134,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_authenticate_duration"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_authenticate_duration"
}
@@ -143,7 +143,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_authenticate_error"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_authenticate_error"
}
@@ -153,7 +153,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.sensor_location"
type: String
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "sensor_location"
}
@@ -162,7 +162,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_authenticate_acquired"
type: String
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_authenticate_acquired"
}
@@ -172,7 +172,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_duration"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_detect_interaction_duration"
}
@@ -184,7 +184,7 @@
prop {
prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_acquired"
type: String
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "operation_detect_interaction_acquired"
}
@@ -193,7 +193,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.sensor_id"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "sensor_id"
}
@@ -203,7 +203,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.sensor_strength"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "sensor_strength"
}
@@ -213,7 +213,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.max_enrollments"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "max_enrollments"
}
@@ -222,7 +222,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.navigation_guesture"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "navigation_guesture"
}
@@ -231,7 +231,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.detect_interaction"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "detect_interaction"
}
@@ -240,7 +240,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.udfps.display_touch"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "display_touch"
}
@@ -249,7 +249,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.udfps.control_illumination"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "control_illumination"
}
@@ -258,7 +258,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.lockout"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "lockout"
}
@@ -267,7 +267,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.lockout_enable"
type: Boolean
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "lockout_enable"
}
@@ -276,7 +276,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.lockout_timed_threshold"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "lockout_timed_threshold"
}
@@ -285,7 +285,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.lockout_timed_duration"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "lockout_timed_duration"
}
@@ -294,7 +294,7 @@
prop {
prop_name: "persist.vendor.fingerprint.virtual.lockout_permanent_threshold"
type: Integer
- scope: Internal
+ scope: Public
access: ReadWrite
api_name: "lockout_permanent_threshold"
}
diff --git a/biometrics/fingerprint/aidl/default/include/VirtualHal.h b/biometrics/fingerprint/aidl/default/include/VirtualHal.h
index e5f62fc..5488383 100644
--- a/biometrics/fingerprint/aidl/default/include/VirtualHal.h
+++ b/biometrics/fingerprint/aidl/default/include/VirtualHal.h
@@ -16,21 +16,21 @@
#pragma once
-#include <aidl/android/hardware/biometrics/fingerprint/BnVirtualHal.h>
+#include <aidl/android/hardware/biometrics/fingerprint/virtualhal/BnVirtualHal.h>
#include "Fingerprint.h"
namespace aidl::android::hardware::biometrics::fingerprint {
+using namespace virtualhal;
+
class VirtualHal : public BnVirtualHal {
public:
- VirtualHal(Fingerprint* fp) : mFp(fp) {}
+ VirtualHal(std::shared_ptr<Fingerprint> fp) : mFp(fp) {}
::ndk::ScopedAStatus setEnrollments(const std::vector<int32_t>& in_id) override;
::ndk::ScopedAStatus setEnrollmentHit(int32_t in_hit_id) override;
- ::ndk::ScopedAStatus setNextEnrollment(
- const ::aidl::android::hardware::biometrics::fingerprint::NextEnrollment&
- in_next_enrollment) override;
+ ::ndk::ScopedAStatus setNextEnrollment(const NextEnrollment& in_next_enrollment) override;
::ndk::ScopedAStatus setAuthenticatorId(int64_t in_id) override;
::ndk::ScopedAStatus setChallenge(int64_t in_challenge) override;
::ndk::ScopedAStatus setOperationAuthenticateFails(bool in_fail) override;
@@ -67,12 +67,15 @@
::ndk::ScopedAStatus setDetectInteraction(bool in_v) override;
::ndk::ScopedAStatus setDisplayTouch(bool in_v) override;
::ndk::ScopedAStatus setControlIllumination(bool in_v) override;
+ ::ndk::ScopedAStatus getFingerprintHal(
+ std::shared_ptr<::aidl::android::hardware::biometrics::fingerprint::IFingerprint>*
+ _aidl_return);
private:
OptIntVec intVec2OptIntVec(const std::vector<int32_t>& intVec);
OptIntVec acquiredInfoVec2OptIntVec(const std::vector<AcquiredInfoAndVendorCode>& intVec);
::ndk::ScopedAStatus sanityCheckLatency(const std::vector<int32_t>& in_latency);
- Fingerprint* mFp;
+ std::shared_ptr<Fingerprint> mFp;
};
} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/main.cpp b/biometrics/fingerprint/aidl/default/main.cpp
index ba0c8ec..8ca44d6 100644
--- a/biometrics/fingerprint/aidl/default/main.cpp
+++ b/biometrics/fingerprint/aidl/default/main.cpp
@@ -24,21 +24,38 @@
using aidl::android::hardware::biometrics::fingerprint::Fingerprint;
using aidl::android::hardware::biometrics::fingerprint::VirtualHal;
-int main() {
- LOG(INFO) << "Fingerprint HAL started";
+int main(int argc, char** argv) {
+ if (argc < 2) {
+ LOG(ERROR) << "Missing argument -> exiting";
+ return EXIT_FAILURE;
+ }
+
+ LOG(INFO) << "Fingerprint HAL started: " << argv[1];
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<Fingerprint> hal = ndk::SharedRefBase::make<Fingerprint>();
- auto binder = hal->asBinder();
-
- std::shared_ptr<VirtualHal> hal_ext = ndk::SharedRefBase::make<VirtualHal>(hal.get());
- auto binder_ext = hal_ext->asBinder();
+ std::shared_ptr<VirtualHal> hal_vhal = ndk::SharedRefBase::make<VirtualHal>(hal);
if (hal->connected()) {
- CHECK(STATUS_OK == AIBinder_setExtension(binder.get(), binder_ext.get()));
- const std::string instance = std::string(Fingerprint::descriptor) + "/virtual";
- binder_status_t status =
- AServiceManager_registerLazyService(binder.get(), instance.c_str());
- CHECK_EQ(status, STATUS_OK);
+ if (strcmp(argv[1], "default") == 0) {
+ const std::string instance = std::string(Fingerprint::descriptor) + "/default";
+ auto binder = hal->asBinder();
+ auto binder_ext = hal_vhal->asBinder();
+ CHECK(STATUS_OK == AIBinder_setExtension(binder.get(), binder_ext.get()));
+ binder_status_t status =
+ AServiceManager_registerLazyService(binder.get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+ LOG(INFO) << "started IFingerprint/default";
+ } else if (strcmp(argv[1], "virtual") == 0) {
+ const std::string instance = std::string(VirtualHal::descriptor) + "/virtual";
+ auto binder = hal_vhal->asBinder();
+ binder_status_t status =
+ AServiceManager_registerLazyService(binder.get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+ LOG(INFO) << "started IVirtualHal/virtual";
+ } else {
+ LOG(ERROR) << "Unexpected argument: " << argv[1];
+ return EXIT_FAILURE;
+ }
AServiceManager_forceLazyServicesPersist(true);
} else {
LOG(ERROR) << "Fingerprint HAL is not connected";
diff --git a/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp b/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp
index 3fe0b2a..8ffc96b 100644
--- a/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp
+++ b/biometrics/fingerprint/aidl/default/tests/VirtualHalTest.cpp
@@ -35,7 +35,7 @@
protected:
void SetUp() override {
mHal = ndk::SharedRefBase::make<Fingerprint>();
- mVhal = ndk::SharedRefBase::make<VirtualHal>(mHal.get());
+ mVhal = ndk::SharedRefBase::make<VirtualHal>(mHal);
ASSERT_TRUE(mVhal != nullptr);
mHal->resetConfigToDefault();
}