Android_Architecture_HAL--HAL Types

说明:转载自Android官网https://source.android.com/devices/architecture/hal,方便国内查看。


HAL Types

In Android 8.0 and higher, the lower-level layers are re-written to adopt a new, more modular architecture. Devices running Android 8.0 and higher must support HALs written in HIDL, with a few exceptions listed below. These HALs can be binderized or passthrough. In Android R, HALs written in AIDL are also supported. All AIDL HALs are binderized.

  • Binderized HALs. HALs expressed in HAL interface definition language (HIDL) or Android interface definition language (AIDL). These HALs replace both conventional and legacy HALs used in earlier versions of Android. In a Binderized HAL, the Android framework and HALs communicate with each other using binder inter-process communication (IPC) calls. All devices launching with Android 8.0 or later must support binderized HALs only.
  • Passthrough HALs. A HIDL-wrapped conventional or legacy HAL. These HALs wrap existing HALs and can serve the HAL in binderized and same-process (passthrough) modes. Devices upgrading to Android 8.0 can use passthrough HALs.

HAL mode requirements


DevicePassthroughBinderized
Launch with Android 8.0HALs listed in Passthrough HALs must be passthrough.All other HALs are binderized (including HALs that are vendor extensions).
Upgrade to Android 8.0HALs listed in Passthrough HALs must be passthrough.HALs listed in Binderized HALs must be binderized.
All other HALs provided by the vendor image can be in passthrough OR binderized mode. In a fully Treble-compliant device, all of these must be binderized.All other HALs provided by the vendor image can be in passthrough OR binderized mode. In a fully Treble-compliant device, all of these must be binderized.

Binderized HALs


Android requires the following HALS to to be binderized on all Android devices regardless of whether they are launch devices or upgrade devices:

  • android.hardware.biometrics.fingerprint@2.1. Replaces fingerprintd which is no longer in Android 8.0.
  • android.hardware.configstore@1.0. New in Android 8.0.
  • android.hardware.dumpstate@1.0. The original interface provided by this HAL could not be shimmed and was changed. Because of this, dumpstate_board must be re-implemented on a given device (this is an optional HAL).
  • android.hardware.graphics.allocator@2.0. Required to be binderized in Android 8.0 so file descriptors don’t have to be shared between trusted and untrusted processes.
  • android.hardware.radio@1.0. Replaces the interface provided by rild which lives in its own process.
  • android.hardware.usb@1.0. New in Android 8.0.
  • android.hardware.wifi@1.0. New in Android 8.0, replaces the legacy Wi-Fi HAL library that was loaded into system_server.
  • android.hardware.wifi.supplicant@1.0. A HIDL interface over the existing wpa_supplicant process.

NOTE: Android provides the following HIDL interfaces which will always be in binderized mode: android.frameworks.*, android.system.* , and android.hidl.* (except for android.hidl.memory@1.0 as described below).

Passthrough HALs


Android requires the following HALs to be in passthrough mode on all Android devices regardless of whether they are launch devices or upgrade devices:

  • android.hardware.graphics.mapper@1.0. Maps memory into the process it lives in.
  • android.hardware.renderscript@1.0. Passes items in the same process (equivalent to openGL).

All HALs not listed above must be binderized for launch devices.

Same-Process HALs


Same-Process HALs (SP-HALs) always open in the same process in which they are used. They include all HALs not expressed in HIDL as well as some that are not binderized. Membership in the SP-HAL set is controlled only by Google, with no exceptions.

SP-HALs include the following:

  • openGL
  • Vulkan
  • android.hidl.memory@1.0 (provided by the Android system, always passthrough)
  • android.hardware.graphics.mapper@1.0.
  • android.hardware.renderscript@1.0

Conventional & legacy HALs


Conventional HALs (deprecated in Android 8.0) are interfaces that conform to a specific named and versioned application binary interface (ABI). The bulk of Android system interfaces (camera, audio, sensors, etc.) are in the form of conventional HALs, which are defined under hardware/libhardware/include/hardware.

Legacy HALs (also deprecated in Android 8.0) are interfaces that predate conventional HALs. A few important subsystems (Wi-Fi, Radio Interface Layer, and Bluetooth) are legacy HALs. While there’s no uniform or standardized way to describe a legacy HAL, anything predating Android 8.0 that is not a conventional HAL is a legacy HAL. Parts of some legacy HALs are contained in libhardware_legacy, while other parts are interspersed throughout the codebase.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值