Clean up package names.

Use license name unless package name is given.

Change the package name for the default android license to Android.

Test: m all
Change-Id: I0049b08fc4955a838e33c8bcfed104dbbf8ec7b1
This commit is contained in:
Bob Badour 2021-04-15 12:43:39 -07:00
parent c1c2352d95
commit 414719e915
2 changed files with 3 additions and 0 deletions

View File

@ -505,6 +505,8 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint
// TODO(b/151177513): Does this code need to set LOCAL_MODULE_IS_CONTAINER ? // TODO(b/151177513): Does this code need to set LOCAL_MODULE_IS_CONTAINER ?
if amod.commonProperties.Effective_package_name != nil { if amod.commonProperties.Effective_package_name != nil {
a.SetString("LOCAL_LICENSE_PACKAGE_NAME", *amod.commonProperties.Effective_package_name) a.SetString("LOCAL_LICENSE_PACKAGE_NAME", *amod.commonProperties.Effective_package_name)
} else if len(amod.commonProperties.Effective_licenses) > 0 {
a.SetString("LOCAL_LICENSE_PACKAGE_NAME", strings.Join(amod.commonProperties.Effective_licenses, " "))
} }
a.SetString("LOCAL_MODULE_CLASS", a.Class) a.SetString("LOCAL_MODULE_CLASS", a.Class)
a.SetString("LOCAL_PREBUILT_MODULE_FILE", a.OutputFile.String()) a.SetString("LOCAL_PREBUILT_MODULE_FILE", a.OutputFile.String())

View File

@ -20,6 +20,7 @@ package {
license { license {
name: "Android-Apache-2.0", name: "Android-Apache-2.0",
package_name: "Android",
license_kinds: ["SPDX-license-identifier-Apache-2.0"], license_kinds: ["SPDX-license-identifier-Apache-2.0"],
copyright_notice: "Copyright (C) The Android Open Source Project", copyright_notice: "Copyright (C) The Android Open Source Project",
license_text: ["LICENSE"], license_text: ["LICENSE"],