aboutsummaryrefslogtreecommitdiffstats
path: root/apex/androidmk.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2020-01-28 20:05:29 +0900
committerBob Badour <bbadour@google.com>2020-01-28 17:20:45 +0000
commit19972c793537fa7292613585519938cf84dd140f (patch)
treefe12dd96d8f8e48cbc83b91bb50e4ca1bfe47aac /apex/androidmk.go
parent7c78b3c98ee42a72131cf3e522a06c61b8fdfe1c (diff)
downloadbuild_soong-19972c793537fa7292613585519938cf84dd140f.tar.gz
build_soong-19972c793537fa7292613585519938cf84dd140f.tar.bz2
build_soong-19972c793537fa7292613585519938cf84dd140f.zip
License info for APEXes are correctly gathered
This change fixes a bug that license info for non-flattened APEXes are not captured in /system/etc/NOTICE.xml.gz file. For non-flatted APEXes, we have been creating NOTICE.html.gz file by concatenating all the license infos of the modules that contributes to the APEX and embedding the file into the asset directory of the APEX. Then at runtime, the info is shown through the "Google Play System Update Licenses" UI. However, this was problematic because the UI only shows license info for the Google-signed APEXes, leaving OEM-signed APEXes (a.k.a. optional modules). The problem is now fixed by associating a merged license file with each APEX and exporting them to Make, so that the merged license files are included in the partition level /system/etc/NOTICE.xml.gz file regardless of whether the APEX is a Google-signed one or not. This also fixes a bug that license info entries are created for the runtime paths /apex/<apex_name>/<path_to_a_file>, which is not necessary as they are already included in the license info of the containing APEX. Bug: N/A Test: Go to Settings->About Phone->Legal information and check that a) /system/apex/*.apex files are shown and b) /apex/<apex_name>/* files are not shown Change-Id: I2c25c803b6a4c39b24bb3f724502699382fab50c
Diffstat (limited to 'apex/androidmk.go')
-rw-r--r--apex/androidmk.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/apex/androidmk.go b/apex/androidmk.go
index 5fa5bf06..be938351 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -112,6 +112,11 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexName, moduleDir string)
}
} else {
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", pathWhenActivated)
+
+ // For non-flattend APEXes, the merged notice file is attached to the APEX itself.
+ // We don't need to have notice file for the individual modules in it. Otherwise,
+ // we will have duplicated notice entries.
+ fmt.Fprintln(w, "LOCAL_NO_NOTICE_FILE := true")
}
fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", fi.builtFile.String())
fmt.Fprintln(w, "LOCAL_MODULE_CLASS :=", fi.class.NameInMake())
@@ -271,6 +276,11 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
if len(postInstallCommands) > 0 {
fmt.Fprintln(w, "LOCAL_POST_INSTALL_CMD :=", strings.Join(postInstallCommands, " && "))
}
+
+ if a.mergedNotices.Merged.Valid() {
+ fmt.Fprintln(w, "LOCAL_NOTICE_FILE :=", a.mergedNotices.Merged.Path().String())
+ }
+
fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
if apexType == imageApex {