aboutsummaryrefslogtreecommitdiff
path: root/en/devices/architecture/vintf/comp-matrices.html
blob: d3512e70e59df4e57712068632883cbf45cd7c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<html devsite>
  <head>
    <title>Compatibility Matrices</title>
    <meta name="project_path" value="/_project.yaml" />
    <meta name="book_path" value="/_book.yaml" />
  </head>
  <body>
  <!--
      Copyright 2017 The Android Open Source Project

      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
  -->

<p>This section describes the framework and device compatibility matrices and
the <a href="#compatiblity-matrix-schema">compatibility matrix schema</a>. For
match rules, see <a href="/devices/architecture/vintf/match-rules.html">Matching
Rules</a>.</p>

<h2 id="framework-compatibility-matrix">Framework compatibility matrix</h2>
<p>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 <code>system.img</code>). 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).</p>

<p>Example framework compatibility matrix file:</p>

<pre class="prettyprint">
&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;!-- Comments, Legal notices, etc. here -->
&lt;compatibility-matrix version="1.0" type="framework">
    &lt;hal>
        &lt;name>android.hardware.camera&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;version>3.1-4&lt;/version>
        &lt;interface>
            &lt;name>ICameraProvider&lt;/name>
            &lt;instance>default&lt;/instance>
        &lt;/interface>
    &lt;/hal>
    &lt;hal>
        &lt;name>android.hardware.nfc&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;interface>
            &lt;name>INfc&lt;/name>
            &lt;instance>default&lt;/instance>
        &lt;/interface>
    &lt;/hal>
    &lt;hal optional="true">
        &lt;name>android.hardware.graphics.composer&lt;/name>
        &lt;version>2.1&lt;/version>
    &lt;/hal>
    &lt;hal format="native">
        &lt;name>GL&lt;/name>
        &lt;version>1.1&lt;/version>
        &lt;version>3.0&lt;/version>
    &lt;/hal>
    &lt;hal format="native">
        &lt;name>EGL&lt;/name>
        &lt;version>1.1&lt;/version>
    &lt;/hal>
    &lt;kernel version="3.18.51">
        &lt;config>
            &lt;key>CONFIG_A&lt;/key>
            &lt;value type="string">&lt;/value>
        &lt;/config>
        &lt;config>
            &lt;key>CONFIG_B&lt;/key>
            &lt;value type="tristate">y&lt;/value>
        &lt;/config>
    &lt;/kernel>
    &lt;kernel version="4.1.22">
        &lt;config>
            &lt;key>CONFIG_A&lt;/key>
            &lt;value type="string">foo&lt;/value>
        &lt;/config>
        &lt;config>
            &lt;key>CONFIG_B2&lt;/key>
            &lt;value type="int">1024&lt;/value>
        &lt;/config>
    &lt;/kernel>
    &lt;sepolicy>
        &lt;kernel-sepolicy-version>30&lt;/kernel-sepolicy-version>
        &lt;sepolicy-version>25.0&lt;/sepolicy-version>
        &lt;sepolicy-version>26.0-3&lt;/sepolicy-version>
    &lt;/sepolicy>
    &lt;avb>
        &lt;vbmeta-version>2.1&lt;/vbmeta-version>
    &lt;/avb>
    &lt;xmlfile format="dtd">
        &lt;name>media_profile&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;path>/system/etc/media_profile_V1_0.dtd&lt;/path>
    &lt;/xmlfile>
&lt;/compatiblity-matrix>
</pre>

<h2 id="device-compatibility-matrix">Device compatibility matrix</h2>
<p>The device compatibility matrix describes a set of requirements the device
expects from the framework (requirements enforced at launch and OTA time).
</p>
<p>Example device compatibility matrix file:</p>

<pre class="prettyprint">
&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;!-- Comments, Legal notices, etc. here -->
&lt;compatibility-matrix version="1.0" type="device">
    &lt;hal>
        &lt;name>android.hidl.manager&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;interface>
            &lt;name>IServiceManager&lt;/name>
            &lt;instance>default&lt;/instance>
        &lt;/interface>
    &lt;/hal>
    &lt;hal>
        &lt;name>android.hidl.memory&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;interface>
            &lt;name>IMemory&lt;/name>
            &lt;instance>ashmem&lt;/instance>
        &lt;/interface>
    &lt;/hal>
    &lt;hal>
        &lt;name>android.hidl.allocator&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;interface>
            &lt;name>IAllocator&lt;/name>
            &lt;instance>ashmem&lt;/instance>
        &lt;/interface>
    &lt;/hal>
    &lt;hal>
        &lt;name>android.framework.sensor&lt;/name>
        &lt;version>1.0&lt;/version>
        &lt;interface>
            &lt;name>ISensorManager&lt;/name>
            &lt;instance>default&lt;/instance>
        &lt;/interface>
    &lt;/hal>
    &lt;xmlfile format="dtd" optional="false">
        &lt;name>sample_xml&lt;/name>
        &lt;version>1.0&lt;/version>
    &lt;/xmlfile>
&lt;/compatibility-matrix>
</pre>

<h2 id="compatiblity-matrix-schema">Compatiblity matrix schema</h2>
<dl>
<dt><code>?xml</code></dt>
<dd>Optional. It only provides information to the XML parser.</dd>
<dt><code>compatibility-matrix.version</code></dt>
<dd>Required. Version of this compatiblity matrix. Describes the elements
expected in the manifest. Unrelated to XML version.</dd>
<dt><code>compatibility-matrix.type</code></dt>
<dd>Required. Type of this compatibility matrix:
 <ul>
 <li><code>"device"</code>: Device compatibility matrix.</li>
 <li><code>"framework"</code>: Framework compatibility matrix.</li>
 </ul>
</dd>
<dt><code>compatibility-matrix.hal</code></dt>
<dd>Optional and can repeat. Lists a single HAL (HIDL or native) that is
required by owner of the compatibility matrix (framework or device) to be
present. HAL entries are distinguished by a <code>&lt;name&gt;</code> element;
there can be several HAL entries with the same name (implies "and" condition).
</dd>
<dt><code>compatibility-matrix.hal.format</code></dt>
<dd>Optional. Value can be one of:
 <ul>
 <li><code>"hidl"</code>: HIDL HALs. This is the default.</li>
 <li><code>"native"</code>: native HALs.</li>
 </ul>
</dd>
<dt><code>compatibility-matrix.hal.optional</code></dt>
<dd>Attribute is optional and defaults to false. States whether this HAL is
optional to the owner of the compatibility matrix (framework or device). If a
<code>&ltp;hal&gt;</code> entry is marked as optional, it means the owner can
work with this HAL, if present, but does not require it to be present.</dd>
<dt><code>compatibility-matrix.hal.name</code></dt>
<dd>Required. Full package name of this HAL. Examples:
 <ul>
 <li><code>android.hardware.camera</code> (HIDL HAL)</li>
 <li><code>GLES</code> (native HAL, requires name only)</li>
 </ul>
</dd>
<dt><code>compatibility-matrix.hal.version</code></dt>
<dd>Required, can repeat without duplicates. A list of version ranges (see
<a href="/devices/architecture/vintf/match-rules.html#hals">HAL matches</a>)
that defines what versions the owner of the compatibility matrix (framework or
device) expects.</dd>
<dt><code>compatibility-matrix.hal.interface</code></dt>
<dd>Optional, can repeat. A list of required interfaces of this HAL.</dd>
<dt><code>compatibility-matrix.hal.interface.name</code></dt>
<dd>Required. Name of the interface.</dd>
<dt><code>compatibility-matrix.hal.interface</code></dt>
<dd>Optional, can repeat. A list of required instances of this interface.</dd>
<dt><code>compatibility-matrix.kernel.version</code></dt>
<dd>Required. Kernel version. Format is
<code>{version}.{major-revision}.{minor-revision}</code>. Version and major
revision must match exactly, minor-revision defines the minimum LTS version of
the kernel the framework expects.</dd>
<dt><code>compatibility-matrix.kernel.config</code></dt>
<dd>Optional, can repeat. Lists <code>CONFIG</code> items that must be
matched for this kernel version. Each <code>CONFIG</code> item is a key-value
pair; config items are distinguished by key.</dd>
<dt><code>compatibility-matrix.kernel.config.key</code></dt>
<dd>Required. Key name of the <code>CONFIG</code> item. Starts with
<code>CONFIG_</code>.</dd>
<dt><code>compatibility-matrix.kernel.config.value</code></dt>
<dd>Required. Value of the <code>CONFIG</code> item. Format depends on type:
 <ul>
 <li><code>string</code>. Quotes are omitted.</li>
 <li><code>int</code>. Decimal and hexadecimal (must start with <code>0x</code>
 or <code>0X)</code>values are accepted. Interpreted as an 64-bit integer;
 overflows result in truncation. (Parser accepts values from -2<sup>64</sup> + 1
 to 2<sup>64</sup> - 1, 65th bit is truncated; for details refer to the
 <a href="http://man7.org/linux/man-pages/man3/strtoul.3.html" class="external">strtoull
 man page</a>.)</li>
 <li><code>range</code>. Format is <code>[int]-[int]</code>, e.g.
 <code>10-20</code>. Hexadecimal values are accepted and must start with
 <code>0x</code> or <code>0X</code>. Two boundaries must be an unsigned 64-bit
 integer.</li>
 <li><code>tristate</code>. Valid values are <code>y</code>, <code>m</code> and
 <code>n</code>.</li>
 </ul>
</dd>
<dt><code>compatibility-matrix.kernel.config.value.type</code></dt>
<dd>Required. Type of the value of the <code>CONFIG</code> item, one of:
 <ul>
 <li><code>string</code></li>
 <li><code>int</code></li>
 <li><code>range</code></li>
 <li><code>tristate</code></li>
 </ul>
</dd>
<dt><code>compatibility-matrix.sepolicy</code></dt>
<dd>Required. Contains all sepolicy-related entries. Used only by the
framework compatibility matrix.</dd>
<dt><code>compatibility-matrix.sepolicy.sepolicy-version</code></dt>
<dd>Required, can repeat. Describes the requirement on sepolicy version.
Corresponds to <code>manifest.sepolicy.version</code>. Each instance of an
element defines a range of sepolicy versions.</dd>
<dt><code>compatibility-matrix.sepolicy.kernel-sepolicy-version</code></dt>
<dd>Required. Declares the <code>policydb</code> version the framework works
with.</dd>
<dt><code>compatibility-matrix.avb.vbmeta-version</code></dt>
<dd>Optional; used only by the framework compatibility matrix. Declares the
<a href="/devices/architecture/vintf/match-rules.html#avb-version">AVB
version</a> used to sign <code>system.img</code>.</dd>
</dl>

  </body>
</html>