diff options
| author | 2021-06-24 14:46:34 +0000 | |
|---|---|---|
| committer | 2021-06-24 14:46:34 +0000 | |
| commit | 770193da6c61669458f76fa347470232772809cc (patch) | |
| tree | fb4c42507a078e95040f341b10cd6dceabb587a8 /java/sdk_library.go | |
| parent | dd9725c177f221a556bedf8c2407236d051601ac (diff) | |
| parent | ea8f808580824fb1c0828ca9bc3644da274e8297 (diff) | |
Merge "Ensure consistent APEX variation for java_sdk_library and java_sdk_library_import"
Diffstat (limited to 'java/sdk_library.go')
| -rw-r--r-- | java/sdk_library.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go index b07dcd151..567e29219 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -684,6 +684,15 @@ func (c *commonToSdkLibraryAndImport) initCommonAfterDefaultsApplied(ctx android return true } +// uniqueApexVariations provides common implementation of the ApexModule.UniqueApexVariations +// method. +func (c *commonToSdkLibraryAndImport) uniqueApexVariations() bool { + // A java_sdk_library that is a shared library produces an XML file that makes the shared library + // usable from an AndroidManifest.xml's <uses-library> entry. That XML file contains the name of + // the APEX and so it needs a unique variation per APEX. + return c.sharedLibrary() +} + func (c *commonToSdkLibraryAndImport) generateCommonBuildActions(ctx android.ModuleContext) { c.doctagPaths = android.PathsForModuleSrc(ctx, c.commonSdkLibraryProperties.Doctag_files) } @@ -1528,6 +1537,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC mctx.CreateModule(DroidstubsFactory, &props) } +// Implements android.ApexModule func (module *SdkLibrary) DepIsInSameApex(mctx android.BaseModuleContext, dep android.Module) bool { depTag := mctx.OtherModuleDependencyTag(dep) if depTag == xmlPermissionsFileTag { @@ -1536,6 +1546,11 @@ func (module *SdkLibrary) DepIsInSameApex(mctx android.BaseModuleContext, dep an return module.Library.DepIsInSameApex(mctx, dep) } +// Implements android.ApexModule +func (module *SdkLibrary) UniqueApexVariations() bool { + return module.uniqueApexVariations() +} + // Creates the xml file that publicizes the runtime library func (module *SdkLibrary) createXmlFile(mctx android.DefaultableHookContext) { props := struct { @@ -2090,6 +2105,11 @@ func (module *SdkLibraryImport) ShouldSupportSdkVersion(ctx android.BaseModuleCo return nil } +// Implements android.ApexModule +func (module *SdkLibraryImport) UniqueApexVariations() bool { + return module.uniqueApexVariations() +} + func (module *SdkLibraryImport) OutputFiles(tag string) (android.Paths, error) { return module.commonOutputFiles(tag) } |