summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2021-07-15 14:14:41 +0100
committerPaul Duffin <paulduffin@google.com>2021-07-15 16:00:11 +0100
commit7b3e10a1c2dfdc2c7cba7d6a7c9a0881ee149ce6 (patch)
tree25c78ad5d02303b2c12853e8162412084f5fcb2c /java/java.go
parentfa20b187dc2471b9cd0705e4c95e7bed1fcd503c (diff)
Propagate permitted packages to sdk snapshot
Previously, permitted_packages were not copied to the sdk snapshot. This change corrects that. Bug: 193763688 Test: m nothing - Added unit tests, which all failed and then fixed the tests. Merged-In: I4560987f746f78c0ae706058195b6db4bea438aa Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa (cherry picked from commit 869de147abdb2c86a91cced4fda7d27746c52af4)
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index ca63782ed..727cef5ee 100644
--- a/java/java.go
+++ b/java/java.go
@@ -581,6 +581,10 @@ type librarySdkMemberProperties struct {
JarToExport android.Path `android:"arch_variant"`
AidlIncludeDirs android.Paths
+
+ // The list of permitted packages that need to be passed to the prebuilts as they are used to
+ // create the updatable-bcp-packages.txt file.
+ PermittedPackages []string
}
func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
@@ -589,6 +593,8 @@ func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberCo
p.JarToExport = ctx.MemberType().(*librarySdkMemberType).jarToExportGetter(ctx, j)
p.AidlIncludeDirs = j.AidlIncludeDirs()
+
+ p.PermittedPackages = j.PermittedPackagesForUpdatableBootJars()
}
func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
@@ -607,6 +613,10 @@ func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberConte
propertySet.AddProperty("jars", []string{snapshotRelativeJavaLibPath})
}
+ if len(p.PermittedPackages) > 0 {
+ propertySet.AddProperty("permitted_packages", p.PermittedPackages)
+ }
+
// Do not copy anything else to the snapshot.
if memberType.onlyCopyJarToSnapshot {
return
@@ -1127,6 +1137,10 @@ type ImportProperties struct {
Installable *bool
+ // If not empty, classes are restricted to the specified packages and their sub-packages.
+ // This information is used to generate the updatable-bcp-packages.txt file.
+ Permitted_packages []string
+
// List of shared java libs that this module has dependencies to
Libs []string