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 framework's compatibility matrix will be satisfied by the
device manifest (requirements enforced at launch and OTA time).
Example framework compatibility matrix file:
<?xml version="1.0" encoding="UTF-8"?> <!-- Comments, Legal notices, etc. here --> <compatibility-matrix version="1.0" type="framework"> <hal> <name>android.hardware.camera</name> <version>1.0</version> <version>3.1-4</version> <interface> <name>ICameraProvider</name> <instance>default</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"> <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"> <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>
The device compatibility matrix describes a set of requirements the device expects from the framework (requirements enforced at launch and OTA time).
Example device compatibility matrix 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> <xmlfile format="dtd" optional="false"> <name>sample_xml</name> <version>1.0</version> </xmlfile> </compatibility-matrix>
?xml
compatibility-matrix.version
compatibility-matrix.type
"device"
: Device compatibility matrix."framework"
: Framework compatibility matrix.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
<p;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.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.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
.