Allow modules to override the default NOTICE file.
It's useful in projects where different top level modules have
different licenses associated with them.
Change-Id: I6214fdeaf038d7a054473f1fbab5315db9b824e4
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 91dfdac..656f327 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -192,6 +192,7 @@
LOCAL_INIT_RC:=
LOCAL_MODULE_HOST_OS:=
LOCAL_FINDBUGS_FLAGS:=
+LOCAL_NOTICE_FILE:=
# arch specific variables
LOCAL_SRC_FILES_$(TARGET_ARCH):=
diff --git a/core/notice_files.mk b/core/notice_files.mk
index cf2dad6..e7f8974 100644
--- a/core/notice_files.mk
+++ b/core/notice_files.mk
@@ -2,7 +2,11 @@
## Track NOTICE files
###########################################################
+ifneq ($(LOCAL_NOTICE_FILE),)
+notice_file:=$(strip $(LOCAL_NOTICE_FILE))
+else
notice_file:=$(strip $(wildcard $(LOCAL_PATH)/NOTICE))
+endif
ifeq ($(LOCAL_MODULE_CLASS),GYP)
# We ignore NOTICE files for modules of type GYP.