From b5cbe22b84ab165f6cb855bcac43dacfeac8196d Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 28 Apr 2017 14:39:50 -0700 Subject: [PATCH] Add device/fwk compatibility matrices to device. Also renamed matrix.xml to compatibility_matrix.xml. Test: make and ensure vendor/compatibility_matrix.xml is there. Test: adb shell vintf (see matrices, compatible = true) Bug: 37321309 Change-Id: I4ebbedf47a576a50a42df53b72e507ed31ef2e56 --- core/Makefile | 1 + core/config.mk | 1 + target/board/Android.mk | 29 +++++++++++++++++++++++++++-- target/product/embedded.mk | 3 ++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/core/Makefile b/core/Makefile index ea6d2d4fc..d5f83736a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2341,6 +2341,7 @@ ifdef INSTALLED_SYSTEMOTHERIMAGE_TARGET endif @# Metadata for compatibility verification. $(hide) cp $(BUILT_SYSTEM_MANIFEST) $(zip_root)/META/system_manifest.xml + $(hide) cp $(BUILT_SYSTEM_COMPATIBILITY_MATRIX) $(zip_root)/META/system_compatibility_matrix.xml ifdef BUILT_VENDOR_MANIFEST $(hide) cp $(BUILT_VENDOR_MANIFEST) $(zip_root)/META/vendor_manifest.xml endif diff --git a/core/config.mk b/core/config.mk index 6d5feb36b..559b987d5 100644 --- a/core/config.mk +++ b/core/config.mk @@ -687,6 +687,7 @@ else endif FRAMEWORK_MANIFEST_FILE := system/libhidl/manifest.xml +FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.xml # ############################################################### # Set up final options. diff --git a/target/board/Android.mk b/target/board/Android.mk index a24abbe56..6f0731b2c 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -30,6 +30,7 @@ endif # Copy compatibility metadata to the device. +# Device Manifest ifdef DEVICE_MANIFEST_FILE include $(CLEAR_VARS) LOCAL_MODULE := manifest.xml @@ -45,16 +46,24 @@ include $(BUILD_PREBUILT) BUILT_VENDOR_MANIFEST := $(LOCAL_BUILT_MODULE) endif +# Device Compatibility Matrix ifdef DEVICE_MATRIX_FILE include $(CLEAR_VARS) -LOCAL_MODULE := matrix.xml +LOCAL_MODULE := compatibility_matrix.xml LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR) -LOCAL_PREBUILT_MODULE_FILE := $(DEVICE_MATRIX_FILE) + +GEN := $(local-generated-sources-dir)/compatibility_matrix.xml +$(GEN): $(DEVICE_MATRIX_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf + # TODO(b/37342627): put BOARD_VNDK_VERSION & BOARD_VNDK_LIBRARIES into device matrix. + $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $< -o $@ + +LOCAL_PREBUILT_MODULE_FILE := $(GEN) include $(BUILD_PREBUILT) BUILT_VENDOR_MATRIX := $(LOCAL_BUILT_MODULE) endif +# Framework Manifest include $(CLEAR_VARS) LOCAL_MODULE := system_manifest.xml LOCAL_MODULE_STEM := manifest.xml @@ -68,3 +77,19 @@ $(GEN): $(FRAMEWORK_MANIFEST_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf LOCAL_PREBUILT_MODULE_FILE := $(GEN) include $(BUILD_PREBUILT) BUILT_SYSTEM_MANIFEST := $(LOCAL_BUILT_MODULE) + +# Framework Compatibility Matrix +include $(CLEAR_VARS) +LOCAL_MODULE := system_compatibility_matrix.xml +LOCAL_MODULE_STEM := compatibility_matrix.xml +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT) + +GEN := $(local-generated-sources-dir)/compatibility_matrix.xml +$(GEN): $(FRAMEWORK_COMPATIBILITY_MATRIX_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf + # TODO(b/37405869) (b/37715375) inject avb versions as well for devices that have avb enabled. + POLICYVERS=$(POLICYVERS) BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $< -o $@ + +LOCAL_PREBUILT_MODULE_FILE := $(GEN) +include $(BUILD_PREBUILT) +BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE) diff --git a/target/product/embedded.mk b/target/product/embedded.mk index b88a14392..06c9c131f 100644 --- a/target/product/embedded.mk +++ b/target/product/embedded.mk @@ -86,9 +86,10 @@ PRODUCT_PACKAGES += \ tzdatacheck \ vndservice \ vndservicemanager \ - matrix.xml \ + compatibility_matrix.xml \ manifest.xml \ system_manifest.xml \ + system_compatibility_matrix.xml \ # SELinux packages PRODUCT_PACKAGES += \