Merge changes from topic "vendor_snapshot-192647618" am: da70df7277

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755250

Change-Id: I1d13f3729a3815d6e97ca40186600b43bbc6f4a2
This commit is contained in:
Treehugger Robot 2021-07-13 09:11:41 +00:00 committed by Automerger Merge Worker
commit 4ba5a02a4d
2 changed files with 7 additions and 6 deletions

View file

@ -2014,9 +2014,9 @@ func AddSharedLibDependenciesWithVersions(ctx android.BottomUpMutatorContext, mo
}
func GetSnapshot(c LinkableInterface, snapshotInfo **SnapshotInfo, actx android.BottomUpMutatorContext) SnapshotInfo {
// Only modules with BOARD_VNDK_VERSION uses snapshot. Others use the zero value of
// Only device modules with BOARD_VNDK_VERSION uses snapshot. Others use the zero value of
// SnapshotInfo, which provides no mappings.
if *snapshotInfo == nil {
if *snapshotInfo == nil && c.Device() {
// Only retrieve the snapshot on demand in order to avoid circular dependencies
// between the modules in the snapshot and the snapshot itself.
var snapshotModule []blueprint.Module
@ -2025,16 +2025,16 @@ func GetSnapshot(c LinkableInterface, snapshotInfo **SnapshotInfo, actx android.
} else if recoverySnapshotVersion := actx.DeviceConfig().RecoverySnapshotVersion(); recoverySnapshotVersion != "current" && recoverySnapshotVersion != "" && c.InRecovery() {
snapshotModule = actx.AddVariationDependencies(nil, nil, "recovery_snapshot")
}
if len(snapshotModule) > 0 {
if len(snapshotModule) > 0 && snapshotModule[0] != nil {
snapshot := actx.OtherModuleProvider(snapshotModule[0], SnapshotInfoProvider).(SnapshotInfo)
*snapshotInfo = &snapshot
// republish the snapshot for use in later mutators on this module
actx.SetProvider(SnapshotInfoProvider, snapshot)
} else {
*snapshotInfo = &SnapshotInfo{}
}
}
if *snapshotInfo == nil {
*snapshotInfo = &SnapshotInfo{}
}
return **snapshotInfo
}

View file

@ -125,6 +125,7 @@ type LinkableInterface interface {
IsPrebuilt() bool
Toc() android.OptionalPath
Device() bool
Host() bool
InRamdisk() bool