自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
供应商接口对象
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档介绍供应商接口对象(VINTF 对象)的设计,该对象用于汇总设备的相关信息并通过可查询的 API 提供该信息。
VINTF 对象设计
VINTF 对象直接从设备中收集所需的一些信息。其他信息(如清单)以 XML 格式静态描述。
图 1. 清单、兼容性矩阵和可在运行时收集的信息。
VINTF 对象的设计为设备和框架组件提供了以下内容:
对于设备 |
对于框架 |
- 定义静态组件(设备清单文件)的架构。
- 添加构建时支持,从而对给定设备的设备清单文件进行定义。
- 在运行时定义相应可查询的 API,以用于检索设备清单文件(以及其他可在运行时收集的信息)并将其打包到查询结果中。
|
|
无论何时收到请求,VINTF 对象都必须稳定可靠且能提供相同的完整信息(请见注意事项)。
清单和矩阵
从 Android 8.0 开始,运行时 API 会查询设备上的内容并将该信息发送到无线下载 (OTA) 更新服务器以及其他相关方(例如 CTS DeviceInfo
)。有些信息会在运行时进行检索,其中有些是静态定义的。
- 设备清单描述了设备可以为框架提供的静态组件。
- 框架兼容性矩阵描述了 Android 框架预期从给定设备中获取的内容。此矩阵是一个静态实体,我们会在开发下一个版本的 Android 框架期间手动确定此矩阵的组成。
- 框架清单描述了框架可以为设备提供的高级层服务。
- 设备兼容性矩阵描述了供应商映像需要框架提供的服务,此矩阵的组成在设备开发期间由开发者手动确定。
这两对清单和矩阵必须在 OTA 时进行协调,以确保设备可以获取与设备功能兼容的框架更新。一般来说,清单描述了提供的内容,兼容性矩阵描述了需要的内容。
本部分包含有关清单和矩阵的以下详细信息:
- 清单定义了设备清单、框架清单和清单文件架构。
- 兼容性矩阵定义了兼容性矩阵的架构。
- FCM 生命周期详细说明了如何废弃和移除 HIDL HAL 以及如何修改 FCM 文件以反映 HAL 版本的状态。
- 制定设备清单描述了供应商如何在设备清单中为新设备定义和声明目标 FCM 版本,或如何在升级旧设备的供应商映像时实现新的 HAL 版本并递增目标 FCM 版本。
- 匹配规则定义了兼容性矩阵与清单之间成功匹配的规则。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Vendor interface object\n\nThis document describes the design of the *vendor interface object*\n(VINTF object), which aggregates relevant information about a device and makes\nthat information available through a *queryable API*.\n\nVINTF object design\n-------------------\n\nA VINTF object gathers some of the information it needs directly from the\ndevice. Other aspects, such as the manifests, are described statically in\nXML.\n\n**Figure 1.** Manifests, compatibility matrixes, and runtime-collectible information.\n\nVINTF object design provides the following for device and framework\ncomponents:\n\n| For the Device | For the Framework |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - Defines a schema for the static component (the [device manifest file](/docs/core/architecture/vintf/objects#device-manifest-file)). - Adds build time support for defining the device manifest file for a given device. - Defines the [queryable API](/docs/core/architecture/vintf/objects#queryable-api) at runtime that retrieves the device manifest file (along with the other runtime-collectible information) and packages them into the query result. | - Defines a schema for the static component (the [framework manifest file](/docs/core/architecture/vintf/objects#framework-manifest-file)). - Defines the [queryable API](/docs/core/architecture/vintf/objects#queryable-api) at runtime that retrieves the framework manifest file and packages it into the query result. |\n\nThe VINTF object must be reliable and provide the same complete information\nregardless of when the object is requested (see\n[Caveats](/docs/core/architecture/vintf/resources#caveats)).\n\nManifests and matrixes\n----------------------\n\nAs of Android 8.0, a runtime API queries what is on the device and sends that\ninformation to the [Over-the-Air (OTA)](/docs/core/ota)\nupdate server and other interested parties (such as CTS\n`DeviceInfo`). Some information is retrieved at runtime and some of\nit is statically-defined.\n\n- The **device manifest** describes the static component of what the device can provide to the framework.\n- The **framework compatibility matrix** describes what the Android framework expects from a given device. The matrix is a static entity whose composition is determined manually during development of the next release of the Android framework.\n- The **framework manifest** describes high-level services the framework can provide to the device.\n- The **device compatibility matrix** describes the services the vendor image requires of the framework. Its composition is determined manually during the development of the device.\n\nThese two pairs of manifests and matrixes must be reconciled at OTA time to\nensure a device can get framework updates that are compatible with the device's\ncapabilities. In general, a *manifest* describes what is provided and a\n*compatibility matrix* describes what is required.\n\nThis section includes the following details on manifests and matrixes:\n\n- [Manifests](/docs/core/architecture/vintf/objects) defines the device manifest, framework manifest, and manifest file schema.\n- [Compatibility\n Matrixes](/docs/core/architecture/vintf/comp-matrices) defines the schema for the compatibility matrix.\n- [FCM Lifecycle](/docs/core/architecture/vintf/fcm) details how HIDL HALs are deprecated and removed and how FCM files are modifed to reflect the status of the HAL Version.\n- [DM Development](/docs/core/architecture/vintf/dm) describes how vendors can define and declare the Target FCM Version in the device manifest for new devices or implement new HAL versions and increment the Target FCM Version when upgrading the vendor image for old devices.\n- [Matching Rules](/docs/core/architecture/vintf/match-rules) defines the rules for a successful match between a compatibility matrix and a manifest."]]