diff --git a/cc/cc.go b/cc/cc.go index 2e094d007..49e218edc 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -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 { diff --git a/cc/sdk.go b/cc/sdk.go index aec950b94..69ad311e2 100644 --- a/cc/sdk.go +++ b/cc/sdk.go @@ -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")