Implement your own HIDL

Purpose: HIDL is intended to be used for inter-process communication (IPC). Some HALs are using another IPC methods like JNI or Socket to communicate with processes.
What do we do for HIDL? How to implement ? 1. (C++->.so)OEM/Vendor should write HAL (server) to register service to system.
Ref. 3. Add your HAL to framework (client) and let upper layer’s service know your driver’s service. (.java)
source system/tools/hidl/
do_makefiles_update \
"{HIDL library name}:{path}"
Output: out/soong/.intermediates/hardware/interfaces/ … / You can find .java and .so which are generated by your HIDL. Method 2: using hidl-gen tool: You may use hidl-gen -h to find the manual. hidl-gen -o {output_path} -L {language} -r {interface name with path}:{interface path} -r android.hidl:system/libhidl/transport {output library name} e.g.
hidl-gen -o output -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport [email protected]::INfc.hal
hidl-gen -L hash -r vendor.awesome:vendor/awesome/hardware/interfaces -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport [email protected]