tree: 32acf505d02d7daeaa82714047a29d4ebd5bb232 [path history] [tgz]
  1. apex/
  2. api/
  3. tests/
  4. Android.bp
  5. face-example.rc
  6. face-example.xml
  7. Face.cpp
  8. Face.h
  9. face.sysprop
  10. FakeFaceEngine.cpp
  11. FakeFaceEngine.h
  12. main.cpp
  13. README.md
  14. Session.cpp
  15. Session.h
biometrics/face/aidl/default/README.md

Face Virtual HAL (VHAL)

This is a virtual HAL implementation that is backed by system properties instead of actual hardware. It's intended for testing and UI development on debuggable builds to allow devices to masquerade as alternative device types and for emulators. Note: The virtual face HAL feature development will be done in phases. Refer to this doc often for the latest supported features

Supported Devices

The face virtual hal is automatically built in in all debug builds (userdebug
and eng) for the latest pixel devices and CF. The instructions in this doc
applies to all

Enabling Face Virtual HAL

On pixel devicse (non-CF), by default (after manufacture reset), Face VHAL is
not enabled. Therefore real Face HAL is used. Face VHAL enabling is gated by the
following two AND conditions:

  1. The Face VHAL feature flag (as part ofTrunk-development strategy) must be
    turned on until the flags life-cycle ends.
  2. The Face VHAL must be enabled via sysprop.

See the adb commands below

Getting Stared

A basic use case for a successful authentication via Face VHAL is given as an exmple below.

Enabling VHAL

$ adb root
$ adb shell device_config put biometrics_framework com.android.server.biometrics.face_vhal_feature true
$ adb shell settings put secure biometric_virtual_enabled 1
$ adb shell setprop persist.vendor.face.virtual.strength strong
$ adb shell setprop persist.vendor.face.virtual.type RGB
$ adb reboot

Direct Enrollment

$ adb shell locksettings set-pin 0000
$ adb shell setprop persist.vendor.face.virtual.enrollments 1
$ adb shell cmd face syncadb shell cmd face sync

Authenticating

To authenticate successfully, the captured (hit) must match the enrollment id
set above. To trigger authentication failure, set the hit id to a different value.

$ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800
$ adb shell setprop vendor.face.virtual.enrollment_hit 1

AcquiredInfo

AcquiredInfo codes can be sent during authentication by specifying the sysprop.
The codes is sent in sequence and in the interval of operation_authentication_duration/numberOfAcquiredInfoCode

$ adb shell setprop vendor.face.virtual.operation_authenticate_acquired 6,9,1013

Refer to AcquiredInfo.aidl for full face acquiredInfo codes. Note: For vendor specific acquired info, acquiredInfo = 1000 + vendorCode.

Error Insertion

Error can be inserted during authentction by specifying the authenticate_error sysprop.

$ adb shell setprop vendor.face.virtual.operation_authenticate_error 4

Refer to Error.aidl for full face error codes

Enrollment via Settings

Enrollment process is specified by sysprop next_enrollment in the following format

Format: <id>:<progress_ms-[acquiredInfo,...],...:<success>
        ----:-----------------------------------:---------
        |           |                               |--->sucess (true/false)
        |           |--> progress_step(s)
        |
        |-->enrollment_id

E.g.
$ adb shell setprop vendor.face.virtual.next_enrollment 1:6000-[21,8,1,1108,1,10,1113,1,1118,1124]:true

If next_enrollment prop is not set, the following default value is used:
  defaultNextEnrollment="1:1000-[21,7,1,1103],1500-[1108,1],2000-[1113,1],2500-[1118,1]:true"
Note: Enrollment data and configuration can be supported upon request in case of needs