Merge "Add support for compat config in APEX." am: 86a5dc5575 am: a53ed40948 am: 085528a57a

Change-Id: I3306751d7bf7ac39656e26e6556a36c8ea536f6f
This commit is contained in:
Automerger Merge Worker
2020-02-05 20:08:07 +00:00
3 changed files with 64 additions and 7 deletions

View File

@@ -1204,6 +1204,12 @@ func apexFileForPrebuiltEtc(ctx android.BaseModuleContext, prebuilt android.Preb
return newApexFile(ctx, fileToCopy, depName, dirInApex, etc, prebuilt)
}
func apexFileForCompatConfig(ctx android.BaseModuleContext, config java.PlatformCompatConfigIntf, depName string) apexFile {
dirInApex := filepath.Join("etc", config.SubDir())
fileToCopy := config.CompatConfig()
return newApexFile(ctx, fileToCopy, depName, dirInApex, etc, config)
}
func apexFileForAndroidApp(ctx android.BaseModuleContext, aapp interface {
android.Module
Privileged() bool
@@ -1371,8 +1377,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
case prebuiltTag:
if prebuilt, ok := child.(android.PrebuiltEtcModule); ok {
filesInfo = append(filesInfo, apexFileForPrebuiltEtc(ctx, prebuilt, depName))
} else if prebuilt, ok := child.(java.PlatformCompatConfigIntf); ok {
filesInfo = append(filesInfo, apexFileForCompatConfig(ctx, prebuilt, depName))
} else {
ctx.PropertyErrorf("prebuilts", "%q is not a prebuilt_etc module", depName)
ctx.PropertyErrorf("prebuilts", "%q is not a prebuilt_etc and not a platform_compat_config module", depName)
}
case testTag:
if ccTest, ok := child.(*cc.Module); ok {