Face Unlock from the bottom to the top (a)

Foreword

This series will explore the original Android Face Unlock stranger, introduced from the bottom to the top, to the underlying hardware, drive, knowledge system services, frameworks, applications, inter-process communication, interface definition language. Welcome to explore and I pointed out my mistake or lack of improvement in the series, to help more people in need.

Face Unlock Overview

Face Unlock that is easy for users to unlock the phone or tablet by looking at the front of the device. Android 10 is supported face unlocked device during face authentication adds a new support face authentication stack can safely handle the camera frame, to maintain privacy and security, but also enable application integration transaction (online for the Security Compliance to bank or other service) provides a means easy to achieve.

Android native face authentication stack in Android 10 is a new realization, and Android P is not the same. The new implementation introduced IBiometricsFace.hal, IBiometricsFaceClientCallback.haland types.halthese interfaces.

Architecture

Here to say to BiometricsPromptthe API, which encompasses all Android biometrics, including face, fingerprint, iris. HAL face interacts with the following components (HAL stands for Hardware Abstraction Layer):

Biometric authentication stack

It can be seen by FingerprintManagercommunication between the system services support libraries and discarded in Android P, Android higher version 10 or by BiometricManagercommunication between the support libraries and system services, system services and drivers and hardware communication, open up from the bottom to the top, in order to achieve face unlock. BiometricManager, BiometricServiceCorrespond to Face Unlock were used FaceManager, FaceServicethe drive and the hardware implementation is defined as faced.

achieve

facedIs achieved FaceServiceusing the Face 1.0 HIDLLinux executable file interface, it registers itself as [email protected]so FaceServiceyou can find it.

IDL

Before speaking HIDL to talk about IDL, because there will be behind AIDL, so do first point of knowledge acquired, to prevent contingencies.

Full IDL interface description language or interface definition language, an application programming interface specification language used to describe software components. IDLs description language independent way interface for communication between the software components that do not share the same programming language, for example, communication between programs that are written in C ++, and the programs written in Java.

IDLs often used for remote procedure call software. These situations may use different computer languages ​​and operating systems connected to both ends of the machine. IDLs provide a bridge between two different operating systems.

filter

HAL i.e. Hardware Abstract Layer, the full name of the hardware abstraction layer. HAL interface definition language or a HIDL a specified interface definition language interface between HAL and its users (IDL). It allows you to specify the interface to collect and package type and method calls. More broadly, HIDL is a system for communication between the compiled code may be independent libraries.

HIDL intended for inter-process communication (IPC). Inter-process communication is called binding (Binderized). It must be linked to a process for the library, also available through mode (does not support Java).

HIDL specified method signatures and data structures, these structures and methods to collect the signatures to the interface package (like a class) organized. While C ++ and Java programmers to use a different set of keywords, but HIDL syntax looks familiar. HIDL also uses Java-style comments.

Reference material

[1] Face Authentication HIDL

[2] Interface description language

[3] Filter

Guess you like

Origin www.cnblogs.com/SSSGLQ/p/12113802.html