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 869de147ab
)
This commit is contained in:
@@ -1893,6 +1893,10 @@ type sdkLibraryImportProperties struct {
|
||||
|
||||
// If set to true, compile dex files for the stubs. Defaults to false.
|
||||
Compile_dex *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
|
||||
}
|
||||
|
||||
type SdkLibraryImport struct {
|
||||
@@ -2506,6 +2510,8 @@ type sdkLibrarySdkMemberProperties struct {
|
||||
|
||||
// The paths to the doctag files to add to the prebuilt.
|
||||
Doctag_paths android.Paths
|
||||
|
||||
Permitted_packages []string
|
||||
}
|
||||
|
||||
type scopeProperties struct {
|
||||
@@ -2546,6 +2552,7 @@ func (s *sdkLibrarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMembe
|
||||
s.Shared_library = proptools.BoolPtr(sdk.sharedLibrary())
|
||||
s.Compile_dex = sdk.dexProperties.Compile_dex
|
||||
s.Doctag_paths = sdk.doctagPaths
|
||||
s.Permitted_packages = sdk.PermittedPackagesForUpdatableBootJars()
|
||||
}
|
||||
|
||||
func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
|
||||
@@ -2558,6 +2565,9 @@ func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberCo
|
||||
if s.Compile_dex != nil {
|
||||
propertySet.AddProperty("compile_dex", *s.Compile_dex)
|
||||
}
|
||||
if len(s.Permitted_packages) > 0 {
|
||||
propertySet.AddProperty("permitted_packages", s.Permitted_packages)
|
||||
}
|
||||
|
||||
for _, apiScope := range allApiScopes {
|
||||
if properties, ok := s.Scopes[apiScope]; ok {
|
||||
|
Reference in New Issue
Block a user