diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-11 03:02:16 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-11 03:02:16 +0000 |
commit | 87697be91150469e1dda4dec0d2bc5605315af6d (patch) | |
tree | c4676153f45e2e7e0bcb67be0e150ab37081e598 | |
parent | b848b740da13b0f54dcda48ab47f171fe4e7d0a5 (diff) | |
parent | 3c8fd299a04914b293954b1f1a95f24398dc1781 (diff) | |
download | build_soong-87697be91150469e1dda4dec0d2bc5605315af6d.tar.gz build_soong-87697be91150469e1dda4dec0d2bc5605315af6d.tar.bz2 build_soong-87697be91150469e1dda4dec0d2bc5605315af6d.zip |
Snap for 5719381 from 3c8fd299a04914b293954b1f1a95f24398dc1781 to qt-qpr1-release
Change-Id: I8efd4ebf8fe855d272996242c554153269c99669
-rw-r--r-- | android/prebuilt.go | 4 | ||||
-rw-r--r-- | apex/apex.go | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/android/prebuilt.go b/android/prebuilt.go index 2556770d..3be10f72 100644 --- a/android/prebuilt.go +++ b/android/prebuilt.go @@ -178,3 +178,7 @@ func (p *Prebuilt) usePrebuilt(ctx TopDownMutatorContext, source Module) bool { return source == nil || !source.Enabled() } + +func (p *Prebuilt) SourceExists() bool { + return p.properties.SourceExists +} diff --git a/apex/apex.go b/apex/apex.go index 65450ccf..cd972942 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1308,7 +1308,8 @@ type Prebuilt struct { type PrebuiltProperties struct { // the path to the prebuilt .apex file to import. - Source string `blueprint:"mutated"` + Source string `blueprint:"mutated"` + ForceDisable bool `blueprint:"mutated"` Src *string Arch struct { @@ -1337,6 +1338,14 @@ func (p *Prebuilt) installable() bool { } func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) { + if ctx.Config().FlattenApex() && !ctx.Config().UnbundledBuild() && p.prebuilt.SourceExists() { + // If the device is configured to use flattened APEX, don't set + // p.properties.Source so that the prebuilt module (which is + // a non-flattened APEX) is not used. + p.properties.ForceDisable = true + return + } + // This is called before prebuilt_select and prebuilt_postdeps mutators // The mutators requires that src to be set correctly for each arch so that // arch variants are disabled when src is not provided for the arch. @@ -1373,6 +1382,10 @@ func (p *Prebuilt) InstallFilename() string { } func (p *Prebuilt) GenerateAndroidBuildActions(ctx android.ModuleContext) { + if p.properties.ForceDisable { + return + } + // TODO(jungjw): Check the key validity. p.inputApex = p.Prebuilt().SingleSourcePath(ctx) p.installDir = android.PathForModuleInstall(ctx, "apex") |