Include /product_services software in NOTICE.
Bug: 111179267
Test: flashed a module with NOTICE file on a devices and checked the
Legal information webview.
Change-Id: I6e52dee0ea23f05ea73d7cc747c2db1c1525f4b2
diff --git a/core/Makefile b/core/Makefile
index 429672c..8bb905e 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -949,10 +949,11 @@
$(2) : $(3)
$(3) : $(6) $(BUILD_SYSTEM)/Makefile build/make/tools/generate-notice-files.py
build/make/tools/generate-notice-files.py --text-output $(2) \
- $(if $(filter $(1),xml_excluded_vendor_product),-e vendor$(comma)product --xml-output, \
+ $(if $(filter $(1),xml_excluded_extra_partitions),-e vendor$(comma)product$(comma)product_services --xml-output, \
$(if $(filter $(1),xml_vendor),-i vendor --xml-output, \
$(if $(filter $(1),xml_product),-i product --xml-output, \
- --html-output))) $(3) \
+ $(if $(filter $(1),xml_product_services),-i product_services --xml-output, \
+ --html-output)))) $(3) \
-t $$(PRIVATE_MESSAGE) -s $$(PRIVATE_DIR)/src
notice_files: $(2) $(3)
endef
@@ -983,6 +984,11 @@
target_product_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml
target_product_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml.gz
installed_product_notice_xml_gz := $(TARGET_OUT_PRODUCT)/etc/NOTICE.xml.gz
+
+target_product_services_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.txt
+target_product_services_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.xml
+target_product_services_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.xml.gz
+installed_product_services_notice_xml_gz := $(TARGET_OUT_PRODUCT_SERVICES)/etc/NOTICE.xml.gz
endif
ifndef TARGET_BUILD_APPS
@@ -991,7 +997,7 @@
pdk_fusion_notice_files := $(filter $(TARGET_OUT_NOTICE_FILES)/%, $(ALL_PDK_FUSION_FILES))
ifdef target_vendor_notice_file_xml_gz
-$(eval $(call combine-notice-files, xml_excluded_vendor_product, \
+$(eval $(call combine-notice-files, xml_excluded_extra_partitions, \
$(target_notice_file_txt), \
$(target_notice_file_html_or_xml), \
"Notices for files contained in the filesystem images in this directory:", \
@@ -1011,6 +1017,14 @@
$(TARGET_OUT_NOTICE_FILES), \
$(target_notice_file_html_or_xml)))
endif
+ifdef target_product_services_notice_file_txt
+$(eval $(call combine-notice-files, xml_product_services, \
+ $(target_product_services_notice_file_txt), \
+ $(target_product_services_notice_file_xml), \
+ "Notices for files contained in the product_services filesystem image in this directory:", \
+ $(TARGET_OUT_NOTICE_FILES), \
+ $(target_notice_file_html_or_xml)))
+endif
else
$(eval $(call combine-notice-files, html, \
$(target_notice_file_txt), \
@@ -1054,6 +1068,14 @@
$(copy-file-to-target)
endif
+ifdef target_product_services_notice_file_xml_gz
+# Install the product html file at /product_services/etc/NOTICE.xml.gz.
+$(target_product_services_notice_file_xml_gz): $(target_product_services_notice_file_xml) | $(MINIGZIP)
+ $(hide) $(MINIGZIP) -9 < $< > $@
+$(installed_product_services_notice_xml_gz): $(target_product_services_notice_file_xml_gz)
+ $(copy-file-to-target)
+endif
+
# if we've been run my mm, mmm, etc, don't reinstall this every time
ifeq ($(ONE_SHOT_MAKEFILE),)
ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz)
@@ -1063,6 +1085,9 @@
ifdef target_product_notice_file_xml_gz
ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_notice_xml_gz)
endif
+ ifdef target_product_services_notice_file_xml_gz
+ ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_services_notice_xml_gz)
+ endif
endif
endif # TARGET_BUILD_APPS