Output apkcerts file for android_app_set.

Soong and Make have no ways to figure out what splits will be outputted
from a given android_app_set, so it's impossible for them to provide
full PACKAGES.$(LOCAL_MODULE).CERTIFICATE entries, which are required to
build a final apkcerts.txt. This change makes extract_apks produce
apkcerts.txt files for each input modules instead. The Make-side
counterpart of this change merges all local apkcerts.txt into a final
one.

Bug: 160119159
Bug: 162464887
Test: main_test.go
Test: m apkcerts-list
Merged-In: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
Change-Id: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
This commit is contained in:
Jaewoong Jung
2020-06-29 19:18:44 -07:00
parent 591e59e511
commit 9cd4216c56
7 changed files with 101 additions and 23 deletions

View File

@@ -614,6 +614,33 @@ func (a *ModuleBase) ProductServicesSpecific() bool {
return Bool(a.commonProperties.Product_services_specific)
}
func (m *ModuleBase) PartitionTag(config DeviceConfig) string {
partition := "system"
if m.SocSpecific() {
// A SoC-specific module could be on the vendor partition at
// "vendor" or the system partition at "system/vendor".
if config.VendorPath() == "vendor" {
partition = "vendor"
}
} else if m.DeviceSpecific() {
// A device-specific module could be on the odm partition at
// "odm", the vendor partition at "vendor/odm", or the system
// partition at "system/vendor/odm".
if config.OdmPath() == "odm" {
partition = "odm"
} else if strings.HasPrefix(config.OdmPath(), "vendor/") {
partition = "vendor"
}
} else if m.ProductSpecific() {
// A product-specific module could be on the product partition
// at "product" or the system partition at "system/product".
if config.ProductPath() == "product" {
partition = "product"
}
}
return partition
}
func (a *ModuleBase) Enabled() bool {
if a.commonProperties.Enabled == nil {
return !a.Os().DefaultDisabled