android_app_import is now ApexModule

Like other prebuilts (java_import, etc.), android_app_import has now
became ApexModule. It means it supports APEX-specific properties like
apex_available, min_sdk_version, etc.

Bug: 154488897
Test: m
Change-Id: I86f02771496ffc68c98a50ddfc786788fa1e05fb
This commit is contained in:
Jiyong Park
2020-04-21 22:34:28 +09:00
parent 1b7599d918
commit 592a6a41de
3 changed files with 21 additions and 1 deletions

View File

@@ -986,6 +986,7 @@ func OverrideAndroidTestModuleFactory() android.Module {
type AndroidAppImport struct {
android.ModuleBase
android.DefaultableModuleBase
android.ApexModuleBase
prebuilt android.Prebuilt
properties AndroidAppImportProperties
@@ -1223,7 +1224,9 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
// TODO: Optionally compress the output apk.
a.installPath = ctx.InstallFile(installDir, apkFilename, a.outputFile)
if a.IsForPlatform() {
a.installPath = ctx.InstallFile(installDir, apkFilename, a.outputFile)
}
// TODO: androidmk converter jni libs
}
@@ -1274,6 +1277,13 @@ func (a *AndroidAppImport) Privileged() bool {
return Bool(a.properties.Privileged)
}
func (a *AndroidAppImport) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
// android_app_import might have extra dependencies via uses_libs property.
// Don't track the dependency as we don't automatically add those libraries
// to the classpath. It should be explicitly added to java_libs property of APEX
return false
}
func createVariantGroupType(variants []string, variantGroupName string) reflect.Type {
props := reflect.TypeOf((*AndroidAppImportProperties)(nil))
@@ -1320,6 +1330,7 @@ func AndroidAppImportFactory() android.Module {
module.processVariants(ctx)
})
android.InitApexModule(module)
InitJavaModule(module, android.DeviceSupported)
android.InitSingleSourcePrebuiltModule(module, &module.properties, "Apk")
@@ -1357,6 +1368,7 @@ func AndroidTestImportFactory() android.Module {
module.processVariants(ctx)
})
android.InitApexModule(module)
InitJavaModule(module, android.DeviceSupported)
android.InitSingleSourcePrebuiltModule(module, &module.properties, "Apk")