From 8fe12122614b554abca1c733a8c9fa21b48ec4b4 Mon Sep 17 00:00:00 2001 From: Justin Yun Date: Thu, 7 Dec 2017 17:18:15 +0900 Subject: [PATCH] Install current VNDK libs to the versioned directories. If PLATFORM_VNDK_VERSION has a version $VER other than "current", install current VNDK libs to /system/lib[64]/vndk[-sp]-$VER. Otherwise, they will be installed to /system/lib[64]/vndk[-sp]. Bug: 69883025 Test: device boot Change-Id: Ifa8564f39687dab5b407bf2178b13022625a94f3 --- android/config.go | 4 ++++ android/variable.go | 1 + cc/library.go | 15 ++++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/android/config.go b/android/config.go index 16870f10b..bf8edcabf 100644 --- a/android/config.go +++ b/android/config.go @@ -648,6 +648,10 @@ func (c *deviceConfig) VndkVersion() string { return String(c.config.ProductVariables.DeviceVndkVersion) } +func (c *deviceConfig) PlatformVndkVersion() string { + return String(c.config.ProductVariables.Platform_vndk_version) +} + func (c *deviceConfig) ExtraVndkVersions() []string { return c.config.ProductVariables.ExtraVndkVersions } diff --git a/android/variable.go b/android/variable.go index ab8103aeb..681543825 100644 --- a/android/variable.go +++ b/android/variable.go @@ -111,6 +111,7 @@ type productVariables struct { Platform_sdk_final *bool `json:",omitempty"` Platform_version_active_codenames []string `json:",omitempty"` Platform_version_future_codenames []string `json:",omitempty"` + Platform_vndk_version *string `json:",omitempty"` DeviceName *string `json:",omitempty"` DeviceArch *string `json:",omitempty"` diff --git a/cc/library.go b/cc/library.go index cf106173d..b664a5ecb 100644 --- a/cc/library.go +++ b/cc/library.go @@ -720,13 +720,14 @@ func (library *libraryDecorator) toc() android.OptionalPath { func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) { if library.shared() { - if ctx.Device() { - if ctx.useVndk() { - if ctx.isVndkSp() { - library.baseInstaller.subDir = "vndk-sp" - } else if ctx.isVndk() { - library.baseInstaller.subDir = "vndk" - } + if ctx.Device() && ctx.useVndk() { + if ctx.isVndkSp() { + library.baseInstaller.subDir = "vndk-sp" + } else if ctx.isVndk() { + library.baseInstaller.subDir = "vndk" + } + if ctx.isVndk() && ctx.DeviceConfig().PlatformVndkVersion() != "current" { + library.baseInstaller.subDir += "-" + ctx.DeviceConfig().PlatformVndkVersion() } } library.baseInstaller.install(ctx, file)