diff options
Diffstat (limited to 'sdk/update.go')
| -rw-r--r-- | sdk/update.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sdk/update.go b/sdk/update.go index 7731fbb3e..7fad5c745 100644 --- a/sdk/update.go +++ b/sdk/update.go @@ -211,6 +211,13 @@ func (s *sdk) buildSnapshot(ctx android.ModuleContext) android.OutputPath { snapshotName := ctx.ModuleName() + string(android.SdkVersionSeparator) + builder.version snapshotModule := bpFile.newModule("sdk_snapshot") snapshotModule.AddProperty("name", snapshotName) + + // Make sure that the snapshot has the same visibility as the sdk. + visibility := android.EffectiveVisibilityRules(ctx, s) + if len(visibility) != 0 { + snapshotModule.AddProperty("visibility", visibility) + } + addHostDeviceSupportedProperties(&s.ModuleBase, snapshotModule) for _, memberListProperty := range sdkMemberListProperties { names := memberListProperty.getter(&s.properties) @@ -368,13 +375,22 @@ func (s *snapshotBuilder) UnzipToSnapshot(zipPath android.Path, destDir string) s.zipsToMerge = append(s.zipsToMerge, tmpZipPath) } -func (s *snapshotBuilder) AddPrebuiltModule(name string, moduleType string) android.BpModule { +func (s *snapshotBuilder) AddPrebuiltModule(member android.SdkMember, moduleType string) android.BpModule { + name := member.Name() if s.prebuiltModules[name] != nil { panic(fmt.Sprintf("Duplicate module detected, module %s has already been added", name)) } m := s.bpFile.newModule(moduleType) m.AddProperty("name", name) + + // Extract visibility information from a member variant. All variants have the same + // visibility so it doesn't matter which one is used. + visibility := android.EffectiveVisibilityRules(s.ctx, member.Variants()[0]) + if len(visibility) != 0 { + m.AddProperty("visibility", visibility) + } + addHostDeviceSupportedProperties(&s.sdk.ModuleBase, m) s.prebuiltModules[name] = m |