diff --git a/android/config.go b/android/config.go index 236192052..686eeb8ec 100644 --- a/android/config.go +++ b/android/config.go @@ -462,11 +462,11 @@ func (c *deviceConfig) VendorPath() string { return "vendor" } -func (c *deviceConfig) VndkVersion() string { +func (c *deviceConfig) CompileVndk() bool { if c.config.ProductVariables.DeviceVndkVersion == nil { - return "" + return false } - return *c.config.ProductVariables.DeviceVndkVersion + return *c.config.ProductVariables.DeviceVndkVersion == "current" } func (c *deviceConfig) BtConfigIncludeDir() string { diff --git a/android/module.go b/android/module.go index 29038422a..4fba1cf7a 100644 --- a/android/module.go +++ b/android/module.go @@ -59,6 +59,7 @@ type androidBaseContext interface { Darwin() bool Debug() bool PrimaryArch() bool + Proprietary() bool AConfig() Config DeviceConfig() DeviceConfig } @@ -87,7 +88,6 @@ type ModuleContext interface { AddMissingDependencies(deps []string) - Proprietary() bool InstallInData() bool InstallInSanitizerDir() bool @@ -461,6 +461,7 @@ func (a *ModuleBase) androidBaseContextFactory(ctx blueprint.BaseModuleContext) return androidBaseContextImpl{ target: a.commonProperties.CompileTarget, targetPrimary: a.commonProperties.CompilePrimary, + proprietary: a.commonProperties.Proprietary, config: ctx.Config().(Config), } } @@ -497,6 +498,7 @@ type androidBaseContextImpl struct { target Target targetPrimary bool debug bool + proprietary bool config Config } @@ -625,8 +627,8 @@ func (a *androidBaseContextImpl) DeviceConfig() DeviceConfig { return DeviceConfig{a.config.deviceConfig} } -func (a *androidModuleContext) Proprietary() bool { - return a.module.base().commonProperties.Proprietary +func (a *androidBaseContextImpl) Proprietary() bool { + return a.proprietary } func (a *androidModuleContext) InstallInData() bool { diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index bdca1aa18..33e7eb398 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -120,7 +120,6 @@ func init() { "LOCAL_NO_STANDARD_LIBRARIES": "no_standard_libraries", "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations", "LOCAL_TIDY": "tidy", - "LOCAL_USE_VNDK": "use_vndk", "LOCAL_PROPRIETARY_MODULE": "proprietary", "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources", diff --git a/cc/androidmk.go b/cc/androidmk.go index 7acc244b2..bf0ca6f9d 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -59,9 +59,6 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) { if c.Target().Os == android.Android && c.Properties.Sdk_version != "" { fmt.Fprintln(w, "LOCAL_SDK_VERSION := "+c.Properties.Sdk_version) fmt.Fprintln(w, "LOCAL_NDK_STL_VARIANT := none") - } else if c.Target().Os == android.Android && c.Properties.Use_vndk { - fmt.Fprintln(w, "LOCAL_USE_VNDK := true") - fmt.Fprintln(w, "LOCAL_NDK_STL_VARIANT := none") } else { // These are already included in LOCAL_SHARED_LIBRARIES fmt.Fprintln(w, "LOCAL_CXX_STL := none") diff --git a/cc/cc.go b/cc/cc.go index 6e026bbd5..f67f82379 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -139,9 +139,6 @@ type BaseProperties struct { // Minimum sdk version supported when compiling against the ndk Sdk_version string - // Whether to compile against the VNDK - Use_vndk bool - // don't insert default compiler flags into asflags, cflags, // cppflags, conlyflags, ldflags, or include_dirs No_default_compiler_flags *bool @@ -149,7 +146,6 @@ type BaseProperties struct { AndroidMkSharedLibs []string `blueprint:"mutated"` HideFromMake bool `blueprint:"mutated"` PreventInstall bool `blueprint:"mutated"` - Vndk_version string `blueprint:"mutated"` } type UnusedProperties struct { @@ -383,8 +379,8 @@ func (ctx *moduleContextImpl) sdk() bool { func (ctx *moduleContextImpl) sdkVersion() string { if ctx.ctx.Device() { - if ctx.mod.Properties.Use_vndk { - return ctx.mod.Properties.Vndk_version + if ctx.vndk() { + return "current" } else { return ctx.mod.Properties.Sdk_version } @@ -393,10 +389,7 @@ func (ctx *moduleContextImpl) sdkVersion() string { } func (ctx *moduleContextImpl) vndk() bool { - if ctx.ctx.Device() { - return ctx.mod.Properties.Use_vndk - } - return false + return ctx.ctx.Os() == android.Android && ctx.ctx.Proprietary() && ctx.ctx.DeviceConfig().CompileVndk() } func (ctx *moduleContextImpl) selectedStl() string { @@ -549,22 +542,11 @@ func (c *Module) begin(ctx BaseModuleContext) { feature.begin(ctx) } if ctx.sdk() { - if ctx.vndk() { - ctx.PropertyErrorf("use_vndk", - "sdk_version and use_vndk cannot be used at the same time") - } - version, err := normalizeNdkApiLevel(ctx.sdkVersion(), ctx.Arch()) if err != nil { ctx.PropertyErrorf("sdk_version", err.Error()) } c.Properties.Sdk_version = version - } else if ctx.vndk() { - version, err := normalizeNdkApiLevel(ctx.DeviceConfig().VndkVersion(), ctx.Arch()) - if err != nil { - ctx.ModuleErrorf("Bad BOARD_VNDK_VERSION: %s", err.Error()) - } - c.Properties.Vndk_version = version } }