HAL know how

@[TOC](HAL known how)

What is HAL?

HAL is short for Hardware abstraction Layer. This is a concept designed by Google to avoid the short of open source which vendors or driver company wanna not open source.

What for?

HAL defines a standard APIs for hardware vendors to implement

Tow generations of HAL

  • The old version : Android OS 7 and below.
  • The newest version : Android OS 8 and higher.

The Newest HAL : Dynamically Available HALs

Android 9 supports the dynamic shutdown of Android hardware subsystems when they are not in use or not needed.
For example, when a user is not using Wi-Fi, the Wi-Fi subsystems should not be taking up memory, power, or other system resources. In earlier versions of Android, HALs/drivers were kept open on Android devices for the entire duration an Android phone was booted.

Change to HAL

# some init.rc script associated with the HAL
    service vendor.some-service-name /vendor/bin/hw/some-binary-service
    # init language extension, provides information of what service is served
    # if multiple interfaces are served, they can be specified one on each line
    interface [email protected]::ILight default
    # restarted if hwservicemanager dies
    # would also cause the hal to start early during boot if disabled wasn't set
    class hal
    # will not be restarted if it exits until it is requested to be restarted
    oneshot
    # will only be started when requested
    disabled
    # ... other properties

to be continued >>

你可能感兴趣的:(HAL know how)