Merge "Fix apex_available" am: 4c8e3509ee
am: 192a8f7385
Change-Id: Iea3359013e011e79acee013f3ce9fc103ee8a166
This commit is contained in:
47
apex/apex.go
47
apex/apex.go
@@ -214,8 +214,11 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"bluetooth-protos-lite",
|
||||
"bluetooth.mapsapi",
|
||||
"com.android.vcard",
|
||||
"dnsresolver_aidl_interface-V2-java",
|
||||
"fmtlib",
|
||||
"guava",
|
||||
"ipmemorystore-aidl-interfaces-V5-java",
|
||||
"ipmemorystore-aidl-interfaces-java",
|
||||
"internal_include_headers",
|
||||
"lib-bt-packets",
|
||||
"lib-bt-packets-avrcp",
|
||||
@@ -281,6 +284,12 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"libutils_headers",
|
||||
"libz",
|
||||
"media_plugin_headers",
|
||||
"net-utils-services-common",
|
||||
"netd_aidl_interface-unstable-java",
|
||||
"netd_event_listener_interface-java",
|
||||
"netlink-client",
|
||||
"networkstack-aidl-interfaces-unstable-java",
|
||||
"networkstack-client",
|
||||
"sap-api-java-static",
|
||||
"services.net",
|
||||
}
|
||||
@@ -298,6 +307,7 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"libcrypto",
|
||||
"libnativehelper_header_only",
|
||||
"libssl",
|
||||
"unsupportedappusage",
|
||||
}
|
||||
//
|
||||
// Module separator
|
||||
@@ -321,6 +331,7 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"cronet_impl_platform_java",
|
||||
"libcronet.80.0.3986.0",
|
||||
"org.chromium.net.cronet",
|
||||
"org.chromium.net.cronet.xml",
|
||||
"prebuilt_libcronet.80.0.3986.0",
|
||||
}
|
||||
//
|
||||
@@ -561,6 +572,7 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"libFLAC-config",
|
||||
"libFLAC-headers",
|
||||
"libFraunhoferAAC",
|
||||
"libLibGuiProperties",
|
||||
"libarect",
|
||||
"libasync_safe",
|
||||
"libaudio_system_headers",
|
||||
@@ -576,6 +588,7 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"libbase",
|
||||
"libbase_headers",
|
||||
"libbinder_headers",
|
||||
"libbinderthreadstateutils",
|
||||
"libbluetooth-types-header",
|
||||
"libbufferhub_headers",
|
||||
"libc++",
|
||||
@@ -781,6 +794,7 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"libdexfile_external_headers",
|
||||
"libdexfile_support",
|
||||
"libdexfile_support_static",
|
||||
"libdl_static",
|
||||
"libgtest_prod",
|
||||
"libjemalloc5",
|
||||
"liblinker_main",
|
||||
@@ -872,6 +886,7 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
m["com.android.wifi"] = []string{
|
||||
"PlatformProperties",
|
||||
"android.hardware.wifi-V1.0-java",
|
||||
"android.hardware.wifi-V1.0-java-constants",
|
||||
"android.hardware.wifi-V1.1-java",
|
||||
"android.hardware.wifi-V1.2-java",
|
||||
"android.hardware.wifi-V1.3-java",
|
||||
@@ -892,6 +907,8 @@ func makeApexAvailableWhitelist() map[string][]string {
|
||||
"bouncycastle-unbundled",
|
||||
"dnsresolver_aidl_interface-V2-java",
|
||||
"error_prone_annotations",
|
||||
"framework-wifi-pre-jarjar",
|
||||
"framework-wifi-util-lib",
|
||||
"ipmemorystore-aidl-interfaces-V3-java",
|
||||
"ipmemorystore-aidl-interfaces-java",
|
||||
"ksoap2",
|
||||
@@ -1028,14 +1045,11 @@ func apexDepsMutator(mctx android.TopDownMutatorContext) {
|
||||
var directDep bool
|
||||
if a, ok := mctx.Module().(*apexBundle); ok && !a.vndkApex {
|
||||
minSdkVersion := a.minSdkVersion(mctx)
|
||||
|
||||
apexBundles = []android.ApexInfo{
|
||||
android.ApexInfo{
|
||||
ApexName: mctx.ModuleName(),
|
||||
LegacyAndroid10Support: proptools.Bool(a.properties.Legacy_android10_support),
|
||||
MinSdkVersion: minSdkVersion,
|
||||
},
|
||||
}
|
||||
apexBundles = []android.ApexInfo{android.ApexInfo{
|
||||
ApexName: mctx.ModuleName(),
|
||||
LegacyAndroid10Support: proptools.Bool(a.properties.Legacy_android10_support),
|
||||
MinSdkVersion: minSdkVersion,
|
||||
}}
|
||||
directDep = true
|
||||
} else if am, ok := mctx.Module().(android.ApexModule); ok {
|
||||
apexBundles = am.ApexVariations()
|
||||
@@ -1046,10 +1060,14 @@ func apexDepsMutator(mctx android.TopDownMutatorContext) {
|
||||
return
|
||||
}
|
||||
|
||||
cur := mctx.Module().(interface {
|
||||
DepIsInSameApex(android.BaseModuleContext, android.Module) bool
|
||||
})
|
||||
|
||||
mctx.VisitDirectDeps(func(child android.Module) {
|
||||
depName := mctx.OtherModuleName(child)
|
||||
if am, ok := child.(android.ApexModule); ok && am.CanHaveApexVariants() &&
|
||||
(directDep || am.DepIsInSameApex(mctx, child)) {
|
||||
cur.DepIsInSameApex(mctx, child) {
|
||||
android.UpdateApexDependency(apexBundles, depName, directDep)
|
||||
am.BuildForApexes(apexBundles)
|
||||
}
|
||||
@@ -1962,7 +1980,7 @@ func (a *apexBundle) walkPayloadDeps(ctx android.ModuleContext,
|
||||
}
|
||||
|
||||
// Check for the indirect dependencies if it is considered as part of the APEX
|
||||
if am.DepIsInSameApex(ctx, am) {
|
||||
if am.ApexName() != "" {
|
||||
do(ctx, parent, am, false /* externalDep */)
|
||||
return true
|
||||
}
|
||||
@@ -1995,10 +2013,12 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
||||
|
||||
a.walkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) {
|
||||
apexName := ctx.ModuleName()
|
||||
if externalDep || to.AvailableFor(apexName) || whitelistedApexAvailable(apexName, to) {
|
||||
fromName := ctx.OtherModuleName(from)
|
||||
toName := ctx.OtherModuleName(to)
|
||||
if externalDep || to.AvailableFor(apexName) || whitelistedApexAvailable(apexName, toName) {
|
||||
return
|
||||
}
|
||||
ctx.ModuleErrorf("%q requires %q that is not available for the APEX.", from.Name(), to.Name())
|
||||
ctx.ModuleErrorf("%q requires %q that is not available for the APEX.", fromName, toName)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2375,13 +2395,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
a.buildApexDependencyInfo(ctx)
|
||||
}
|
||||
|
||||
func whitelistedApexAvailable(apex string, module android.Module) bool {
|
||||
func whitelistedApexAvailable(apex, moduleName string) bool {
|
||||
key := apex
|
||||
key = strings.Replace(key, "test_", "", 1)
|
||||
key = strings.Replace(key, "com.android.art.debug", "com.android.art", 1)
|
||||
key = strings.Replace(key, "com.android.art.release", "com.android.art", 1)
|
||||
|
||||
moduleName := module.Name()
|
||||
// Prebuilt modules (e.g. java_import, etc.) have "prebuilt_" prefix added by the build
|
||||
// system. Trim the prefix for the check since they are confusing
|
||||
moduleName = strings.TrimPrefix(moduleName, "prebuilt_")
|
||||
|
Reference in New Issue
Block a user