summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/config.go4
-rw-r--r--android/variable.go2
-rw-r--r--cc/library.go2
3 files changed, 7 insertions, 1 deletions
diff --git a/android/config.go b/android/config.go
index fa439625d..8b573ec74 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1355,6 +1355,10 @@ func (c *config) BazelModulesForceEnabledByFlag() map[string]struct{} {
return c.bazelForceEnabledModules
}
+func (c *config) IsVndkDeprecated() bool {
+ return !Bool(c.productVariables.KeepVndk)
+}
+
func (c *deviceConfig) Arches() []Arch {
var arches []Arch
for _, target := range c.config.Targets[Android] {
diff --git a/android/variable.go b/android/variable.go
index 3bec854ea..82a330abf 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -474,6 +474,8 @@ type productVariables struct {
ReleaseVersion string `json:",omitempty"`
ReleaseAconfigValueSets []string `json:",omitempty"`
+
+ KeepVndk *bool `json:",omitempty"`
}
func boolPtr(v bool) *bool {
diff --git a/cc/library.go b/cc/library.go
index aec6433d8..db83d22e5 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -2271,7 +2271,7 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
// do not install vndk libs
// vndk libs are packaged into VNDK APEX
- if ctx.isVndk() && !ctx.IsVndkExt() {
+ if ctx.isVndk() && !ctx.IsVndkExt() && !ctx.Config().IsVndkDeprecated() {
return
}
} else if library.hasStubsVariants() && !ctx.Host() && ctx.directlyInAnyApex() {