Revert "Revert "Add command line tool that generates NOTICE.xml...."

Revert submission 3272666-revert-3273112-soong-notice-xml-XKFAUDLTXP

Reason for revert: reland it

Reverted changes: /q/submissionid:3272666-revert-3273112-soong-notice-xml-XKFAUDLTXP

Change-Id: Ica8daafbc5f1bc0bc473c939c595666403349739
diff --git a/core/Makefile b/core/Makefile
index b0392cd..0bc6f1f 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1964,7 +1964,7 @@
 installed_system_dlkm_notice_xml_gz := $(TARGET_OUT_SYSTEM_DLKM)/etc/NOTICE.xml.gz
 
 ALL_INSTALLED_NOTICE_FILES := \
-  $(installed_notice_html_or_xml_gz) \
+  $(if $(USE_SOONG_DEFINED_SYSTEM_IMAGE),,$(installed_notice_html_or_xml_gz)) \
   $(installed_vendor_notice_xml_gz) \
   $(installed_product_notice_xml_gz) \
   $(installed_system_ext_notice_xml_gz) \
@@ -2051,7 +2051,9 @@
 
 endif # PRODUCT_NOTICE_SPLIT
 
+ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true)
 ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz)
+endif
 
 need_vendor_notice:=false
 ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true)