Difference between HAL and HIDL

938 Views Asked by At

I have recently started working on android native framework for some development work and after going through Android documents I am still not able to clearly understand concept of HIDL. I am sorry if questions sound stupid, but I have just started learning this.

In Hidl-c++ document on source.android, this image is present.

  1. What is the HIDL actually? Since its name is HAL Interface Definition Language, it is confusing me whether it is just a way to define a HAL or a new layer between framework and HAL ?
  2. If HIDL is just a way to define a HAL and was introduced from android 8.0, then how the HAL was defined in android versions before 8.0 ?
  3. As per documents, in binderized HAL two separate processes communicate through binder like client-server model. Does this mean, the process on framework side is client and the process on hardware side is server, and server process actually communicates with hardware and provides necessary result to client via via /dev/hwbinder ? Is this understanding correct ?
  4. In case of binderized HAL, does server process always keep running in background or does it spawn only when a client process requests for it ?
  5. Do vendors define HAL interfaces specific to their hardware to access it ? How separating the vendor partition makes the difference ?

I found this image somewhere. Is this a correct representation ? enter image description here

1

There are 1 best solutions below

0
On

HAL defines the interface with a C header, and the vendor needs to implement it with C/C++ and compile it as a library, which the framework can then load it.

HIDL defines the interface with the HAL file, which can be compiled to C/C++/Java. It can then be implemented with C/C++ and run as a server. It can also be called from a Java client with a different process.

HIDL is a modern way of defining interfaces and can be easily tested and versioned.