From ea448b829ef3c5eefcadcd50fdf74c873eeadd86 Mon Sep 17 00:00:00 2001
From: Android Partner Docs
To match a device manifest with a framework compatibility matrix,
+the Shipping FCM version specified by manifest.target-level
+must exactly equal to the FCM version specified by
+compatibility-matrix.level
. Otherwise there is no match.
If the framework compatibility matrix is requested with
+libvintf
, this match is always successful because
+libvintf
opens the device manifest, retrieves the Shipping FCM
+Version, and returns the framework compatibility matrix at that Shipping FCM
+Version (plus some optional HALs from compatibility matrices at higher FCM
+Versions).
The HAL-match rule identifies the versions of hal
elements in a
manifest file that are considered supported by the owner of the corresponding
compatibility matrix.
version
elements are concatenated with
-OR (see camera example below).<hal>
elements with the same name are
-concatenated with AND.<hal>
elements have AND
+relationship.<version>
elements within the same
+<hal>
have
+OR relationship. If two or more are specified, only
+one of the version needs to be implemented (see DRM example below).<instance>
and
+<regex-instance>
elements within the same
+<hal>
have
+AND relationship (see DRM example below).A vendor must implement ONE of the following HALs:
+A vendor must implement ONE of the following instances:
-android.hardware.drm@1.x::IDrmFactory/default //where x >= 0 -android.hardware.drm@1.x::IDrmFactory/specific //where x >= 0 +android.hardware.drm@1.x::IDrmFactory/default // where x >= 0 +android.hardware.drm@1.x::IDrmFactory/specific // where x >= 0OR
-android.hardware.drm@3.y::IDrmFactory/default //where y >= 1 -android.hardware.drm@3.y::IDrmFactory/specific //where y >= 1 +android.hardware.drm@3.y::IDrmFactory/default // where y >= 1 +android.hardware.drm@3.y::IDrmFactory/specific // where y >= 1-
... AND must also implement this HAL:
+... AND must also implement all of these instances:
-android.hardware.drm@2.z::ICryptoFactory/default //where z >= 0 +android.hardware.drm@2.z::ICryptoFactory/default // where z >= 0 +android.hardware.drm@2.z::ICryptoFactory/${INSTANCE} + // where z >= 0 and ${INSTANCE} matches [a-z]+/[0-9]+ + // e.g. legacy/0
<kernel-sepolicy-version>
i.e. policydb version. Must
-exactly match the security_policyvers()
reported by the device.
+be less than the security_policyvers()
reported by the device.
security_policyvers()
reported by the device.
- <sepolicy> - <kernel-sepolicy-version>30</kernel-sepolicy-version> - <sepolicy-version>25.0</sepolicy-version> - <sepolicy-version>26.0-3</sepolicy-version> - </sepolicy> +<sepolicy> + <kernel-sepolicy-version>30</kernel-sepolicy-version> + <sepolicy-version>25.0</sepolicy-version> + <sepolicy-version>26.0-3</sepolicy-version> +</sepolicy>
On the device:
security_policyvers()
must exactly equal
-30. Otherwise it is not a match.security_policyvers()
must be greater
+than or equal to 30. Otherwise it is not a match. For example:
+-3
" after "26.0
" is purely
informational.)The device compatibility matrix declares the required VNDK version in
+compatibility-matrix.vendor-ndk.version
. If the device
+compatibility matrix does not have a <vendor-ndk>
tag, no
+requirements are imposed, and hence it is always considered a match.
If the device compatibility matrix does have a <vendor-ndk>
+tag, an <vendor-ndk>
entry with a matching
+<version>
is looked up from the set of VNDK vendor snapshots
+provided by the framework in the framework manifest. If such an entry does not
+exist, there is no match.
If such entry does exist, the set of libraries enumerated in the device +compatibility matrix must be a subset of the set of libraries stated in the +framework manifest; otherwise, the entry is not considered a match.
+If the device compatibility matrix states the following requirement on VNDK: +
+ ++<!-- Example Device Compatibility Matrix --> +<vendor-ndk> + <version>27</version> + <library>libjpeg.so</library> + <library>libbase.so</library> +</vendor-ndk> ++ +
In the framework manifest, only the entry with version 27 is considered.
+ ++<!-- Framework Manifest Example A --> +<vendor-ndk> + <version>27</version> + <library>libjpeg.so</library> + <library>libbase.so</library> + <library>libfoo.so</library> +</vendor-ndk> ++ +
Example A is a match, because VNDK version 27 is in the framework manifest,
+and {libjpeg.so, libbase.so, libfoo.so} ⊇ {libjpeg.so, libbase.so}
.
+
+<!-- Framework Manifest Example B --> +<vendor-ndk> + <version>26</version> + <library>libjpeg.so</library> + <library>libbase.so</library> +</vendor-ndk> +<vendor-ndk> + <version>27</version> + <library>libbase.so</library> +</vendor-ndk> ++ +
Example B is not a match. Even though VNDK version 27 is in the framework
+manifest, libjpeg.so
is not supported by the framework in that
+snapshot. VNDK version 26 is ignored.
The device compatibility matrix declares a set of required System SDK
+version in compatibility-matrix.system-sdk.version
. There is a
+match only if the set is a subset of provided System SDK versions as declared
+in manifest.system-sdk.version
in the framework manifest.
If the device compatibility matrix states the following requirement on System +SDK: +
+ ++<!-- Example Device Compatibility Matrix --> +<system-sdk> + <version>26</version> + <version>27</version> +</system-sdk> ++ +
Then, the framework must provide System SDK version 26 and 27 to match.
+ ++<!-- Framework Manifest Example A --> +<system-sdk> + <version>26</version> + <version>27</version> +</system-sdk> ++ +
Example A is a match.
+ ++<!-- Framework Manifest Example B --> +<system-sdk> + <version>26</version> + <version>27</version> + <version>28</version> +</system-sdk> ++ +
Example B is a match.
+ ++<!-- Framework Manifest Example C --> +<system-sdk> + <version>26</version> +</system-sdk> ++ +
Example C is not a match, because System SDK version 27 is not provided.
+