Android系统之VINTF(1)manifests&compatibility matrices

adtxl
2021-03-02 / 0 评论 / 5,093 阅读 / 正在检测是否收录...

1. 概览

1.1 概述

VINTF对象(vendor interface object),即供应商接口对象,该对象用于汇总设备的相关信息,并通过可查询的 API 提供相关信息。
Framework(system)和Device(vendor)匹配的框架如下:
image.png

VINTF 对象设计为设备和框架组件提供以下内容:

For the DeciceFor the Framework
- Defines a schema for the static component (the device manifest file).
- Adds build time support for defining the device manifest file for a given device.
- Defines the 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).
- Defines the queryable API at runtime that retrieves the framework manifest file and packages it into the query result.

无论何时请求,VINTF 对象都必须稳定可靠且能提供相同的完整信息请见注意事项

1.2 Manifests&matrixes

从 Android 8.0 开始,运行时 API 会查询设备上的内容并将该信息发送到无线下载 (OTA) 更新服务器以及其他相关方(例如 CTS DeviceInfo)。有些信息会在运行时进行检索,而有些信息则是静态定义的信息。

  • The device manifest describes the static component of what the device can provide to the framework.
  • 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.
  • The framework manifest describes high-level services the framework can provide to the device.
  • 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.

Manifest 描述了提供给对方的feature, Matrix 描述了需要对方提供的feature。Manifest 和 Matrix 在OTA升级前会进行匹配检查,以确保framework和device是兼容的。总的来说,manifest是提供端,matrix是需求端。

2. Manifests

VINTF 对象会汇总设备清单(device manifest)和框架清单(framework manifest)文件 (XML) 中的数据。这两个清单采用同一种格式,不过并非所有元素都适用于两者。

2.1 Device manifest

一般定义在对应device的BoardConfig.mk中,
DEVICE_MANIFEST_FILE += device/VENDOR/DEVICE/manifest/manifest.xml

设备清单(由设备提供)包含供应商清单(vendor manifest)和 ODM manifest。

  • 供应商清单会指定 SoC 通用的 HAL、SELinux 政策版本等。谷歌建议将其放置在 Android 源代码树的 device/VENDOR/DEVICE/manifest.xml 中,但可以使用多个 Fragment 文件。
  • ODM 清单列出了 ODM 分区中的产品专用 HAL。VINTF 对象会按以下顺序加载 ODM 清单:

    1. /odm/etc/vintf/manifest_SKU.xml(如果定义了 SKU,其中 SKU 是属性 ro.boot.product.hardware.sku 的值)
    2. /odm/etc/vintf/manifest.xml
    3. /odm/etc/manifest_SKU.xml(如果定义了 SKU)
    4. /odm/etc/manifest.xml
  • 供应商清单列出了 vendor 分区中的产品专用 HAL。VINTF 对象会按以下顺序加载供应商清单:

    1. /vendor/etc/vintf/manifest_SKU.xml(如果定义了 SKU,其中 SKU 是属性 ro.boot.product.vendor.sku 的值)
    2. /vendor/etc/vintf/manifest.xml
  • VINTF 对象会按以下顺序加载设备清单:
  1. 如果存在vendor manifest,combine the following:

    • 供应商清单
    • 可选的 vendor manifest fragments
    • 可选的 ODM 清单
    • 可选的 ODM manifest fragments
  2. 否则,如果存在 ODM 清单,将 ODM 清单与可选的 ODM 清单片段合并在一起。
  3. /vendor/manifest.xml(legacy,no fragments)

请注意:

  • 在旧版设备上,使用旧版供应商清单和 ODM 清单。ODM 清单可能会完全覆盖旧版供应商清单。
  • 在搭载 Android 9 的设备上,ODM 清单会与供应商清单合并。
  • 合并清单列表时,列表中后出现的清单可能会覆盖列表中先出现的清单中的标记,但前提是后出现的清单中的标记具有 override="true" 属性。例如,ODM 清单可能会覆盖供应商清单中的某些 <hal> 标记。

此设置可让采用相同开发板的多个产品共用同一个vendor manifest(用于提供通用 HAL),但具有不同的 ODM 映像(用于指定产品专用的 HAL)。

下面是一个示例vendor manifest

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<manifest version="2.0" type="device" target-level="1">
    <hal>
        <name>android.hardware.camera</name>
        <transport>hwbinder</transport>
        <version>3.4</version>
        <interface>
            <name>ICameraProvider</name>
            <instance>legacy/0</instance>
            <instance>proprietary/0</instance>
        </interface>
    </hal>
    <hal>
        <name>android.hardware.nfc</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <version>2.0</version>
        <interface>
            <name>INfc</name>
            <instance>nfc_nci</instance>
        </interface>
    </hal>
    <hal>
        <name>android.hardware.nfc</name>
        <transport>hwbinder</transport>
        <fqname>@2.0::INfc/default</fqname>
    </hal>
    <hal>
        <name>android.hardware.drm</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>ICryptoFactory</name>
            <instance>default</instance>
        </interface>
        <interface>
            <name>IDrmFactory</name>
            <instance>default</instance>
        </interface>
        <fqname>@1.1::ICryptoFactory/clearkey</fqname>
        <fqname>@1.1::IDrmFactory/clearkey</fqname>
    </hal>
    <hal format="aidl">
        <name>android.hardware.light</name>
        <version>1</version>
        <fqname>ILights/default</fqname>
    </hal>
    <hal format="aidl">
        <name>android.hardware.power</name>
        <version>2</version>
        <interface>
            <name>IPower</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="native">
        <name>EGL</name>
        <version>1.1</version>
    </hal>
    <hal format="native">
        <name>GLES</name>
        <version>1.1</version>
        <version>2.0</version>
        <version>3.0</version>
    </hal>
    <sepolicy>
        <version>25.0</version>
    </sepolicy>
</manifest>

下面是一个示例 ODM manifest。

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<manifest version="1.0" type="device">
    <!-- camera 3.4 in vendor manifest is ignored -->
    <hal override="true">
        <name>android.hardware.camera</name>
        <transport>hwbinder</transport>
        <version>3.5</version>
        <interface>
            <name>ICameraProvider</name>
            <instance>legacy/0</instance>
        </interface>
    </hal>
    <!-- NFC is declared to be disabled -->
    <hal override="true">
        <name>android.hardware.nfc</name>
        <transport>hwbinder</transport>
    </hal>
    <hal>
        <name>android.hardware.power</name>
        <transport>hwbinder</transport>
        <version>1.1</version>
        <interface>
            <name>IPower</name>
            <instance>default</instance>
        </interface>
    </hal>
</manifest>

下面是 OTA 软件包中的一个示例device manifest。

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<manifest version="1.0" type="device" target-level="1">
    <!-- hals ommited -->
    <kernel version="4.4.176">
        <config>
            <key>CONFIG_ANDROID</key>
            <value>y</value>
        </config>
        <config>
            <key>CONFIG_ARM64</key>
            <value>y</value>
        </config>
    <!-- other configs ommited -->
    </kernel>
</manifest>

2.2 Framework manifest

The framework manifest file consists of the system manifest, the product manifest, and the system_ext manifest.

  • 系统清单(由 Google 提供)是手动生成的,位于 Android 源代码树的 /system/libhidl/manifest.xml 中。注:Android11似乎在system/libhidl/vintfdata/中。
  • 产品清单(provided by the device)列出了由 product 分区上安装的模块提供服务的 HAL。
  • system_ext 清单(provided by the device)列出了以下内容:

    • 安装在 system_ext 分区中的 HAL模块;
    • VNDK versions;
    • System SDK version。

与device manifest类似,可以使用多个 Fragment 文件。

下面是一个示例framework manifest。

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<manifest version="1.0" type="framework">
    <hal>
        <name>android.hidl.allocator</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>IAllocator</name>
            <instance>ashmem</instance>
        </interface>
    </hal>
    <hal>
        <name>android.hidl.memory</name>
        <transport arch="32+64">passthrough</transport>
        <version>1.0</version>
        <interface>
            <name>IMapper</name>
            <instance>ashmem</instance>
        </interface>
    </hal>
    <hal>
        <name>android.hidl.manager</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>IServiceManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal>
        <name>android.frameworks.sensorservice</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>ISensorManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <vendor-ndk>
        <version>27</version>
    </vendor-ndk>
    <system-sdk>
        <version>27</version>
    </system-sdk>
</manifest>

2.3 Manifest fragments

Android 10 及更高版本中,您可以在构建系统中将清单条目与 HAL 模块相关联。这有助于在构建系统中有条件地包含 HAL 模块。

示例

在您的 Android.bp 或 Android.mk 文件中,将 vintf_fragments 添加到任意模块。例如,您可以修改实现了 HAL 的模块 (my.package.foo@1.0-service-bar)。

... {
    ...
    vintf_fragments: ["manifest_foo.xml"],
    ...
}

or in Android.mk

LOCAL_MODULE := ...
LOCAL_VINTF_FRAGMENTS := manifest_foo.xml

在名为 manifest_foo.xml 的文件中,为此模块创建清单。在构建时,此清单会添加到设备中。在此处添加条目与在设备的主清单中添加条目相同。这样,客户端就可以使用该接口,并允许 VTS 识别设备上的 HAL 实现。此清单会执行常规清单执行的任何操作。

下面的示例实现了安装到 vendorodm 分区的 android.hardware.foo@1.0::IFoo/default。如果安装到 systemproductsystem_ext 分区,则改为使用 framework 类型,而不是 device 类型。

<manifest version="1.0" type="device">
    <hal format="hidl">
        <name>android.hardware.foo</name>
        <transport>hwbinder</transport>
        <fqname>@1.0::IFoo/default</fqname>
    </hal>
</manifest>

2.4 清单文件架构(Manifest file schema)

这一部分介绍了下列 XML tags的含义。某些“required”的标记可以在构建时由 assemble_vintf 写入,因此不一定要包含在 Android 源代码树中的源文件中。设备上的相应文件中必须有“required”标记。

?xml
可选。只向 XML 解析器提供信息。

manifest.version
必需。Meta-version of this manifest. Describes the elements expected in the manifest. Unrelated to XML version.

manifest.type
必需。该清单的类型。对于设备清单文件,其值为 device;对于框架清单文件,其值为 framework。

manifest.target-level
对于设备清单而言是必需的。Specifies the framework compatibility matrix (FCM) version that this device manifest is targeted to be compatible with. This is also called the shipping FCM version of the device.

manifest.hal
可选且可重复。单个 HAL(HIDL 或本机,如 GL),具体取决于 format 属性。

manifest.hal.format
可选。值可以是:
hidl:HIDL HAL。这是默认值。
aidl:AIDL HAL。 Only valid at manifest meta-version 2.0 and above.
native:本机 HAL。

manifest.hal.override
可选。值可以是:

- true:覆盖其他具有相同 `<name>` 和 Major 版本的 `<hal>` 元素。如果此 `<hal>` 元素中没有 `<version>` 或 `<fqname>`,则 `<hal>` 元素会声明此 HAL 将被停用。
- false:不替换其他具有相同 `<name>` 和主要版本的 `<hal>` 元素。

manifest.hal.name
必需。HAL 的完全限定软件包名称。多个 HAL 条目可以使用相同的名称。示例:
android.hardware.camera(HIDL 或 AIDL HAL)
GLES(本机 HAL,只需提供名称)

manifest.hal.transport
manifest.hal.format == "hidl" 时是必需的。在其他情况下,则不得存在。指明从服务管理器查询来自该软件包的接口时使用什么传输模式。值可以是:
hwbinder:绑定模式
passthrough:直通模式

manifest.hal.transport.arch
对于 passthrough 是必需的,对于 hwbinder 不得存在。描述正在提供的直通服务的位数。值可以是:
32:32 位模式
64:64 位模式
32+64:两者

manifest.hal.version
可选且可重复。清单中 hal 标记的版本。

对于 HIDL 和原生 HAL,格式为 MAJOR.MINOR。如需查看示例,请参阅 hardware/interfaces、vendor/${VENDOR}/interfaces、framework/hardware/interfaces 或 system/hardware/interfaces。

HIDL 和原生 HAL 可以使用多个版本字段,前提是它们代表不同的 Major 版本,并且提供的每个 Major 版本只有一个 Minor 版本。例如,3.1 和 3.2 不能共存,但 1.0 和 3.4 可以共存。这适用于所有同名的 hal 元素,除非 override="true"。<version> 的值与 <fqname> 不相关联,因为 <fqname> 带有版本信息。

对于 AIDL HAL,不得在搭载 Android 11 及以下版本的设备上存在 <version><version> 必须是搭载 Android 12 及更高版本的设备上的一个整数。每个 (package, interface, instance) 元组最多只能有一个 <version>。如果不存在,则默认设置为 1。<version> 的值与同一 <hal> 中的所有 <fqname> 相关联,因为 <fqname> 不带版本信息。

manifest.hal.interface
必需,可以在不重名的情况下重复。指明软件包中具有实例名称的接口。一个 <hal> 中可以有多个 <interface> 元素,但名称必须不同。

manifest.hal.interface.name
必需。接口的名称。

manifest.hal.interface.instance
必需且可重复。接口的实例名称。一个接口可以有多个实例,但不能有重复的 <instance> 元素。

manifest.hal.fqname
可选且可重复。为名称是 manifest.hal.name 的 HAL 指定实例的另一种方法。
对于 HIDL HAL,格式为 @MAJOR.MINOR::INTERFACE/INSTANCE
对于 AIDL HAL,格式为 INTERFACE/INSTANCE

manifest.sepolicy
必需。包含所有与 sepolicy 相关的条目。

manifest.sepolicy.version
对于设备清单而言是必需的。声明 SELinux 版本。格式为 SDK_INT.PLAT_INT

manifest.vendor-ndk
必需且可重复;对于框架清单而言是必需的。不得出现在设备清单中。多个 <vendor-ndk> 条目必须具有不同的 <version>。用于描述框架提供的一组 VNDK 快照。

manifest.vendor-ndk.version
必需。一个正整数,表示 VNDK 快照的版本。

manifest.vendor-ndk.library
可选,可以在不重名的情况下重复。用于描述框架为此 VNDK 供应商快照提供的一组 VNDK 库。值是库的文件名,例如 libjpeg.so,包含前缀 lib 和后缀 .so。不允许添加路径组件。

manifest.system-sdk.version
可选,可以在不重名的情况下重复;仅供框架清单使用。用于描述框架为供应商应用提供的一组系统 SDK 版本。

manifest.kernel
可选。描述有关内核的静态信息。

manifest.kernel.target-level
可选。描述内核分支。如果其值不存在,则默认其值为 manifest.target-level。必须大于等于 manifest.target-level。如需了解详情,请参阅内核匹配规则。

3. Compatibility Matrixes

本部分介绍了框架和设备兼容性矩阵(framework and device compatibility matrixes)以及兼容性矩阵架构( compatibility matrix schema)。

3.1 Framework compatibility matrix (FCM)

框架兼容性矩阵 (FCM) 说明了框架对运行它的设备的要求。框架兼容性矩阵包含系统兼容性矩阵(system compatibilty matrix)、产品兼容性矩阵( product compatibility matrix)和 system_ext 兼容性矩阵(system_ext compatibility matrix)。
设备清单必须符合 FCM 的要求(即在构建时、运行时和 VTS 中强制执行的要求)。

system_ext FCM 和产品 FCM 是对设备专用 FCM(安装在系统分区中)的补充。

  • 设备 FCM 应反映系统分区中各模块的要求。
  • system_ext FCM 应反映 system_ext 分区中各模块的要求。
  • 产品 FCM 应反映产品分区中各模块的要求。

All of the FCMs should align with an OEM's modifications to the framework in the system, product, and system_ext partitions. For example, if an app installed in the product partition uses a vendor extension of a HAL interface, the HAL interface requirement should be declared in the product FCM.

系统兼容性矩阵文件示例:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<compatibility-matrix version="1.0" type="framework" level="3">
    <hal>
        <name>android.hardware.camera</name>
        <version>1.0</version>
        <version>3.1-4</version>
        <interface>
            <name>ICameraProvider</name>
            <instance>default</instance>
            <regex-instance>[a-z_]+/[0-9]+</regex-instance>
        </interface>
    </hal>
    <hal>
        <name>android.hardware.nfc</name>
        <version>1.0</version>
        <interface>
            <name>INfc</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal optional="true">
        <name>android.hardware.graphics.composer</name>
        <version>2.1</version>
        <interface>
            <name>IComposer</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.light</name>
        <version>1-2</version>
        <interface>
            <name>ILights</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="native">
        <name>GL</name>
        <version>1.1</version>
        <version>3.0</version>
    </hal>
    <hal format="native">
        <name>EGL</name>
        <version>1.1</version>
    </hal>
    <kernel version="3.18.51">
        <!-- common configs -->
    </kernel>
    <kernel version="3.18.51">
        <!-- arm specific configs -->
        <condition>
            <config>
                <key>CONFIG_ARM</key>
                <value type="tristate">y</value>
            </config>
        <condition>
        <config>
            <key>CONFIG_A</key>
            <value type="string"></value>
        </config>
        <config>
            <key>CONFIG_B</key>
            <value type="tristate">y</value>
        </config>
    </kernel>
    <kernel version="4.1.22">
        <!-- common configs -->
        <config>
            <key>CONFIG_A</key>
            <value type="string">foo</value>
        </config>
        <config>
            <key>CONFIG_B2</key>
            <value type="int">1024</value>
        </config>
    </kernel>
    <sepolicy>
        <kernel-sepolicy-version>30</kernel-sepolicy-version>
        <sepolicy-version>25.0</sepolicy-version>
        <sepolicy-version>26.0-3</sepolicy-version>
    </sepolicy>
    <avb>
        <vbmeta-version>2.1</vbmeta-version>
    </avb>
    <xmlfile format="dtd">
        <name>media_profile</name>
        <version>1.0</version>
        <path>/system/etc/media_profile_V1_0.dtd</path>
    </xmlfile>
</compatibility-matrix>

有关详情,请参阅 FCM 生命周期。

3.2 产品兼容性矩阵

产品 FCM 是产品分区中的一份框架兼容性矩阵文件。VINTF 对象在运行时将加入产品 FCM 与系统和 system_ext 分区中的 FCM。

产品 FCM 文件示例:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<compatibility-matrix version="1.0" type="framework">
    <hal>
        <name>vendor.foo.camera</name>
        <version>1.0</version>
        <interface>
            <name>IBetterCamera</name>
            <instance>default</instance>
        </interface>
    </hal>
</compatibility-matrix>

3.3 system_ext 兼容性矩阵

system_ext FCM 是 system_ext 分区中的一份框架兼容性矩阵文件。The VINTF object joins the system_ext FCM with FCMs in the system and product partitions at runtime.如需查看 system_ext FCM 文件示例,请参阅产品兼容性矩阵。

3.4 设备兼容性矩阵 (DCM)

设备兼容性矩阵说明了设备期望框架满足的一组要求(在启动和 OTA 时会强制执行相应要求)。
The device compatibility matrix describes a set of requirements the device expects from the framework (requirements enforced at launch and OTA time).

DCM 文件示例:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Comments, Legal notices, etc. here -->
<compatibility-matrix version="1.0" type="device">
    <hal>
        <name>android.hidl.manager</name>
        <version>1.0</version>
        <interface>
            <name>IServiceManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal>
        <name>android.hidl.memory</name>
        <version>1.0</version>
        <interface>
            <name>IMemory</name>
            <instance>ashmem</instance>
        </interface>
    </hal>
    <hal>
        <name>android.hidl.allocator</name>
        <version>1.0</version>
        <interface>
            <name>IAllocator</name>
            <instance>ashmem</instance>
        </interface>
    </hal>
    <hal>
        <name>android.framework.sensor</name>
        <version>1.0</version>
        <interface>
            <name>ISensorManager</name>
            <instance>default</instance>
        </interface>
    </hal>
    <vendor-ndk>
        <version>27</version>
    </vendor-ndk>
    <system-sdk>
        <version>27</version>
    </system-sdk>
</compatibility-matrix>

3.5 兼容性矩阵架构(Compatibility matrix schema)

本部分介绍了下列 XML 标记的含义。某些“必需”的标记可以在构建时由 assemble_vintf 写入,因此不一定要包含在 Android 源代码树中的源文件中。设备上的相应文件中必须有此类“必需”的标记。

?xml
可选。它只向 XML 解析器提供信息。

compatibility-matrix.version
必需。此兼容性矩阵的元版本。描述兼容性矩阵中预期的元素。与 XML 版本无关。

compatibility-matrix.type
必需。此兼容性矩阵的类型:
"device":设备兼容性矩阵。
"framework":框架兼容性矩阵。

manifest.level
对于框架兼容性矩阵是必需的。指定此文件的框架兼容性矩阵版本(FCM 版本)。不应在设备专用的框架兼容性矩阵(即 DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE)中声明。

compatibility-matrix.hal
可选且可重复。列出兼容性矩阵(框架或设备)的所有者要求存在的单个 HAL(HIDL 或原生)。HAL 条目通过 元素来区分,可以有多个同名的 HAL 条目(暗含“and”条件)。

compatibility-matrix.hal.format
可选。值可以是以下几项之一:

  • "hidl":HIDL HAL。这是默认值。
  • "aidl":AIDL HAL。Only valid on compatibility matrix meta-version 2.0.
  • "native":原生 HAL。

compatibility-matrix.hal.optional
此属性是可选的,默认值为 false。指明此 HAL 对兼容性矩阵(框架或设备)的所有者来说是否是可选的。如果某 条目被标记为可选的,则表示在 HAL 存在的情况下,所有者可以使用此 HAL,但 HAL 并非是必须存在的。

compatibility-matrix.hal.name
必需。此 HAL 的完整软件包名称。例如:
android.hardware.camera(HIDL 或 AIDL HAL)
GLES(原生 HAL,只需提供名称)

compatibility-matrix.hal.version
版本范围的列表(请参阅 HAL 匹配),用于定义兼容性矩阵(框架或设备)的所有者期望的版本。

  • 对于 HIDL 和原生 HAL 是必需的,可以在不重名的情况下重复。格式为下列之一:
    MAJOR.MINOR_MIN-MINOR_MAX
    MAJOR.MINOR(相当于 MAJOR.MINOR-MINOR
  • 对于 AIDL HAL,不得在搭载 Android 11 及以下版本的设备上存在。在搭载更高版本的设备上是可选的。如果指定,则格式为下列之一:
    VERSION_MIN-VERSION_MAX
    VERSION(相当于 VERSION-VERSION
    如果未指定,则值默认为 1。

compatibility-matrix.hal.interface
可选且可重复。该 HAL 的必需接口的列表。

compatibility-matrix.hal.interface.name
必需。接口的名称。

compatibility-matrix.hal.interface.instance
可选且可重复。此接口的必需实例的列表。

compatibility-matrix.hal.interface.regex-instance
可选且可重复。此接口上的必需实例名称模式的列表。使用扩展正则表达式格式。

compatibility-matrix.kernel
可选且可重复。指定框架在每个内核版本上必需的内核配置列表。
可以存在具有同一 <version> 的多个 <kernel>,暗含“and”关系。每个 <kernel> 都是要求的一个“片段”;仅当满足 <conditions> 时,相应要求才会被启用。

compatibility-matrix.kernel.version
必需。内核版本。格式为 VERSION.MAJOR_REVISION.MINOR_REVISION。版本和主要修订版本必须完全匹配。次要修订版本将定义框架期望内核所能达到的最低 LTS 版本。

compatibility-matrix.kernel.condition
可选。对于每个版本的第一个 <kernel>,不得指定此属性。列明条件。仅当满足条件时,此 片段中声明的要求才会被启用。

compatibility-matrix.kernel.config
可选且可重复。列出此内核版本必须匹配的 CONFIG 项。每个 CONFIG 项是一个键值对,配置项通过键来区分。

compatibility-matrix.kernel.config.key
必需。CONFIG 项的键名称。以 CONFIG_ 开头。

compatibility-matrix.kernel.config.value
必需。CONFIG 项的值。格式视类型而定:

  • string - 省略引号。
  • int - 接受十进制和十六进制值(开头必须是 0x 或 0X) )。解释为一个 64 位的整数,溢出部分会被截断。(解析器接受从 -264 + 1 到 264 - 1 的值,第 65 位会被截断;如需了解详情,请参阅 strtoull 手册页。)
  • range - 格式为 [int]-[int],例如 10-20。接受十六进制值,且值必须以 0x 或 0X 开头。两个边界必须是一个无符号的 64 位整数。
  • tristate - 有效值为 y、m 和 n。

compatibility-matrix.kernel.config.value.type
必需。CONFIG 项的值的类型,可以是以下几项之一:

  • string
  • int
  • range
  • tristate

compatibility-matrix.sepolicy
必需。包含所有与 sepolicy 相关的条目。仅供框架兼容性矩阵使用。

compatibility-matrix.sepolicy.sepolicy-version
必需且可重复。描述对 sepolicy 版本的要求。对应于 manifest.sepolicy.version。元素的每个实例定义一系列 sepolicy 版本。

compatibility-matrix.sepolicy.kernel-sepolicy-version
必需。声明框架支持的 policydb 版本。

compatibility-matrix.avb.vbmeta-version
可选,仅供框架兼容性矩阵使用。声明用于签署 system.img 的 AVB 版本。在 Android 10 中已弃用。

compatibility-matrix.vendor-ndk
可选,仅供设备兼容性矩阵使用。声明 VNDK 供应商快照的要求。如果缺失,则系统映像对 VNDK 没有要求。

compatibility-matrix.vendor-ndk.version
必需。正整数,用于声明供应商映像所需的 VNDK 版本。

compatibility-matrix.vendor-ndk.library
可选且可重复。声明供应商映像所需的一组 VNDK 库。与 manifest.vendor-ndk.library 语义相同。

compatibility-matrix.system-sdk.version
可选且可重复,仅供设备兼容性矩阵使用。声明供应商应用对 System SDK 版本的要求。如果缺失,则系统映像对系统 SDK 没有要求。

0

评论 (0)

取消