This section describes the framework and device compatibility matrices and the compatibility matrix schema. For match rules, see Matching Rules.
The framework compatibility matrix describes the requirements of the
framework on the device it runs on. The matrix file is associated with the
Android framework image (on system.img
). It is expected the
requirements of the FCM will be satisfied by the device manifest (requirements
enforced at launch and OTA time).
Example FCM file:
<?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> </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>
For more details, see FCM Lifecycle.
The device compatibility matrix describes a set of requirements the device expects from the framework (requirements enforced at launch and OTA time).
Example DCM file:
<?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>
This section describes the meaning of these XML tags. Some "required" tags
can be missing from the source file in Android source tree and written by
assemble_vintf
at build time. "Required" tags must be present in the corresponding files on the
device.
?xml
compatibility-matrix.version
compatibility-matrix.type
"device"
: Device compatibility matrix."framework"
: Framework compatibility matrix.manifest.level
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
).compatibility-matrix.hal
<name>
element;
there can be several HAL entries with the same name (implies "and" condition).
compatibility-matrix.hal.format
"hidl"
: HIDL HALs. This is the default."native"
: native HALs.compatibility-matrix.hal.optional
<hal>
entry is marked as optional, it means the owner can
work with this HAL, if present, but does not require it to be present.compatibility-matrix.hal.name
android.hardware.camera
(HIDL HAL)GLES
(native HAL, requires name only)compatibility-matrix.hal.version
compatibility-matrix.hal.interface
compatibility-matrix.hal.interface.name
compatibility-matrix.hal.interface.instance
compatibility-matrix.hal.interface.regex-instance
compatibility-matrix.kernel
<kernel>
with the same <version>
can
exist to imply "and" relationship. Each <kernel>
is a "fragment"
of the requirements that are enabled only when <conditions>
are
met.compatibility-matrix.kernel.version
VERSION.MAJOR_REVISION.MINOR_REVISION
.
Version and major revision must match exactly. Minor revision defines the
minimum LTS version of the kernel the framework expects.compatibility-matrix.kernel.condition
<kernel>
of each
version. Specifies a list of conditions. Only when the conditions are met are
the requirements stated in this <kernel>
fragment is enabled.
compatibility-matrix.kernel.config
CONFIG
items that must be
matched for this kernel version. Each CONFIG
item is a key-value
pair; config items are distinguished by key.compatibility-matrix.kernel.config.key
CONFIG
item. Starts with
CONFIG_
.compatibility-matrix.kernel.config.value
CONFIG
item. Format depends on type:
string
. Quotes are omitted.int
. Decimal and hexadecimal (must start with 0x
or 0X)
values are accepted. Interpreted as an 64-bit integer;
overflows result in truncation. (Parser accepts values from -264 + 1
to 264 - 1, 65th bit is truncated; for details refer to the
strtoull
man page.)range
. Format is [int]-[int]
, e.g.
10-20
. Hexadecimal values are accepted and must start with
0x
or 0X
. Two boundaries must be an unsigned 64-bit
integer.tristate
. Valid values are y
, m
and
n
.compatibility-matrix.kernel.config.value.type
CONFIG
item, one of:
string
int
range
tristate
compatibility-matrix.sepolicy
compatibility-matrix.sepolicy.sepolicy-version
manifest.sepolicy.version
. Each instance of an
element defines a range of sepolicy versions.compatibility-matrix.sepolicy.kernel-sepolicy-version
policydb
version the framework works
with.compatibility-matrix.avb.vbmeta-version
system.img
.compatibility-matrix.vendor-ndk
compatibility-matrix.vendor-ndk.version
compatibility-matrix.vendor-ndk.library
manifest.vendor-ndk.library
.compatibility-matrix.system-sdk.version