summaryrefslogtreecommitdiffstats
path: root/compatibility_matrices
diff options
context:
space:
mode:
Diffstat (limited to 'compatibility_matrices')
-rw-r--r--compatibility_matrices/Android.mk39
-rw-r--r--compatibility_matrices/compatibility_matrix.mk14
-rw-r--r--compatibility_matrices/manifest.empty.xml1
3 files changed, 50 insertions, 4 deletions
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index 71253dac78..a10d808d33 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -22,6 +22,7 @@ BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := $(LOCAL_PATH)/compatibility_matrix.mk
LOCAL_ADD_VBMETA_VERSION :=
LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
LOCAL_ASSEMBLE_VINTF_FLAGS :=
+LOCAL_WARN_REQUIRED_HALS :=
LOCAL_KERNEL_VERSIONS :=
LOCAL_GEN_FILE_DEPENDENCIES :=
@@ -57,14 +58,46 @@ include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
# Framework Compatibility Matrix (common to all FCM versions)
include $(CLEAR_VARS)
-LOCAL_MODULE_STEM := compatibility_matrix.empty.xml
-LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
+LOCAL_MODULE_STEM := compatibility_matrix.device.xml
+# define LOCAL_MODULE and LOCAL_MODULE_CLASS for local-generated-sources-dir.
+LOCAL_MODULE := framework_compatibility_matrix.device.xml
+LOCAL_MODULE_CLASS := ETC
+
+ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
+LOCAL_SRC_FILES := compatibility_matrix.empty.xml
+else
+
+# DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specify an absolute path
+LOCAL_GENERATED_SOURCES := $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE)
+
+# Enforce that DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE does not specify required HALs
+# by checking it against an empty manifest. But the empty manifest needs to contain
+# BOARD_SEPOLICY_VERS to be compatible with DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE.
+my_manifest_src_file := $(LOCAL_PATH)/manifest.empty.xml
+my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml
+$(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_manifest_src_file)
+$(my_gen_check_manifest): $(my_manifest_src_file) $(HOST_OUT_EXECUTABLES)/assemble_vintf
+ BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \
+ IGNORE_TARGET_FCM_VERSION=true \
+ $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@
+
+LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest)
+LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)"
+
+my_gen_check_manifest :=
+my_manifest_src_file :=
+
+endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
+
LOCAL_ADD_VBMETA_VERSION := true
LOCAL_ASSEMBLE_VINTF_ENV_VARS := \
POLICYVERS \
PLATFORM_SEPOLICY_VERSION \
PLATFORM_SEPOLICY_COMPAT_VERSIONS
+LOCAL_WARN_REQUIRED_HALS := \
+ "Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs."
+
include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
# Framework Compatibility Matrix
@@ -78,7 +111,7 @@ LOCAL_REQUIRED_MODULES := \
framework_compatibility_matrix.1.xml \
framework_compatibility_matrix.2.xml \
framework_compatibility_matrix.current.xml \
- framework_compatibility_matrix.empty.xml
+ framework_compatibility_matrix.device.xml
LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES))
ifdef BUILT_VENDOR_MANIFEST
diff --git a/compatibility_matrices/compatibility_matrix.mk b/compatibility_matrices/compatibility_matrix.mk
index 96815b83e1..abc679656b 100644
--- a/compatibility_matrices/compatibility_matrix.mk
+++ b/compatibility_matrices/compatibility_matrix.mk
@@ -29,8 +29,13 @@ ifndef LOCAL_MODULE_STEM
$(error LOCAL_MODULE_STEM must be defined.)
endif
+ifndef LOCAL_MODULE
LOCAL_MODULE := framework_$(LOCAL_MODULE_STEM)
+endif
+
+ifndef LOCAL_MODULE_CLASS
LOCAL_MODULE_CLASS := ETC
+endif
ifndef LOCAL_MODULE_PATH
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/vintf
@@ -76,13 +81,19 @@ my_matrix_src_files := \
$(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) \
$(LOCAL_GENERATED_SOURCES)
+ifneq (,$(strip $(LOCAL_WARN_REQUIRED_HALS)))
+$(GEN): PRIVATE_ADDITIONAL_ENV_VARS += PRODUCT_ENFORCE_VINTF_MANIFEST=true
+$(GEN): PRIVATE_COMMAND_TAIL := || (echo $(strip $(LOCAL_WARN_REQUIRED_HALS)) && false)
+endif
+
$(GEN): PRIVATE_SRC_FILES := $(my_matrix_src_files)
$(GEN): $(my_matrix_src_files) $(HOST_OUT_EXECUTABLES)/assemble_vintf
$(foreach varname,$(PRIVATE_ENV_VARS),$(varname)="$($(varname))") \
+ $(PRIVATE_ADDITIONAL_ENV_VARS) \
$(HOST_OUT_EXECUTABLES)/assemble_vintf \
-i $(call normalize-path-list,$(PRIVATE_SRC_FILES)) \
-o $@ \
- $(PRIVATE_FLAGS)
+ $(PRIVATE_FLAGS) $(PRIVATE_COMMAND_TAIL)
LOCAL_PREBUILT_MODULE_FILE := $(GEN)
LOCAL_SRC_FILES :=
@@ -91,6 +102,7 @@ LOCAL_GENERATED_SOURCES :=
LOCAL_ADD_VBMETA_VERSION :=
LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
LOCAL_ASSEMBLE_VINTF_FLAGS :=
+LOCAL_WARN_REQUIRED_HALS :=
LOCAL_KERNEL_VERSIONS :=
LOCAL_GEN_FILE_DEPENDENCIES :=
my_matrix_src_files :=
diff --git a/compatibility_matrices/manifest.empty.xml b/compatibility_matrices/manifest.empty.xml
new file mode 100644
index 0000000000..e50e0e539d
--- /dev/null
+++ b/compatibility_matrices/manifest.empty.xml
@@ -0,0 +1 @@
+<manifest version="1.0" type="device" />