打工人自习室

HAL know how

2020-12-22  本文已影响0人  叶非叶

@[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 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 android.hardware.light@2.0::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 >>

上一篇下一篇

猜你喜欢

热点阅读