Make the IsSdkVariant field and method the same.

Before, the IsSdkVariant() method also checked AlwaysSdk(). Instead,
sdkMutator now sets the IsSdkVariant field to True even for the single
variation it creates when AlwaysSdk is true.

Test: Presubmits.
Change-Id: Ied8b42a3441a30484ef8c5dff5aade5fe92574bb
This commit is contained in:
Lukacs T. Berki 2021-06-17 09:32:36 +02:00
parent 2c891873d6
commit 2063a0d7b8
2 changed files with 3 additions and 2 deletions

View file

@ -3383,7 +3383,7 @@ func DefaultsFactory(props ...interface{}) android.Module {
}
func (c *Module) IsSdkVariant() bool {
return c.Properties.IsSdkVariant || c.AlwaysSdk()
return c.Properties.IsSdkVariant
}
func kytheExtractAllFactory() android.Singleton {

View file

@ -35,7 +35,8 @@ func sdkMutator(ctx android.BottomUpMutatorContext) {
if !m.UseSdk() && !m.SplitPerApiLevel() {
ctx.ModuleErrorf("UseSdk() must return true when AlwaysSdk is set, did the factory forget to set Sdk_version?")
}
ctx.CreateVariations("sdk")
modules := ctx.CreateVariations("sdk")
modules[0].(*Module).Properties.IsSdkVariant = true
} else if m.UseSdk() || m.SplitPerApiLevel() {
modules := ctx.CreateVariations("", "sdk")