VINTF - compatibility matrix

Compatibility Matrix (CM)

1. 系统共需要3个compatibility matrix文件

  • System Compatibility Matrix (hardware/interfaces/compatibility_matrices/Android.mk), 下文简称scm
  • Device Compatibility Matrix (system/libhidl/vintfdata/Android.mk), 下文简称vcm
  • Product Compatibility Matrix (hardware/interfaces/compatibility_matrices/Android.mk), 下文简称pcm

其中scm, vcm是必然要生成的,而pcm则只有在定义了DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE之后才会生成。

scm:

该文件生成比较繁琐,需要多个步骤
首先需要生成CM的check文件:
-i hardware/interfaces/compatibility_matrices/manifest.empty.xml -o manifest.check.xml
需要生成6个实际文件

compatibility_matrix.1.xml
compatibility_matrix.2.xml
compatibility_matrix.3.xml
compatibility_matrix.4.xml
compatibility_matrix.legacy.xml
compatibility_matrix.device.xml (FCM)
前5个文件定义于hardware/interfaces/compatibility_matrices/Android.bp, 从同文件夹的同名文件加上多个版本的kernel config生成(目前看到对于Oreo是3.18, 4.4, 4.9 等, 对于Q是4.9, 4.14, 4.19等)
第6个文件FCM, 从DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE或者compatibility_matrix.empty.xml生成

vcm:

额外需要的变量 REQUIRED_VNDK_VERSION, BOARD_SYSTEMSDK_VERSIONS, 生成的CM带有VDNK版本号和SYSTEMSDK版本号

pcm:

强制check文件为空, 参数增加”-c hardware/interfaces/compatibility_matrices/manifest.empty.xml”

2. 图表总结

+--------+-----------------------------------------+-------------------------------+--------------------------------------------+
|Targets | Makefile Commands |output | 源文件(input files) | |
+--------+-----------------------------------------+-------------------------------+--------------------------------------------+
|scm(fcm)| make |/system/etc/vintf/ | compatibility_matrix.empty.xml |
| |framework_compatibility_matrix.device.xml|compatibility_matrix.device.xml| or |
| | | | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
+--------+-----------------------------------------+-------------------------------+--------------------------------------------+
|scm(all)| make system_compatibility_matrix.xml | scm + other 5 files | 同名源文件 + 多个版本的kernel config |
+--------+-----------------------------------------+-------------------------------+--------------------------------------------+
|vcm | make device_compatibility_matrix.xml |/vendor/etc/vintf/ | device_compatibility_matrix.default.xml |
| | |compatibility_matrix.xml | or DEVICE_MATRIX_FILE |
+--------+-----------------------------------------+-------------------------------+--------------------------------------------+
|pcm | make product_compatibility_matrix.xml |/product/etc/vintf/ | DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE |
| | |compatibility_matrix.xml | |
+--------+-----------------------------------------+-------------------------------+--------------------------------------------+