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
diff --git a/cc/library.go b/cc/library.go
index cf10617..b664a5e 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -720,13 +720,14 @@
 
 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)