Use current VNDK directories if version is not set on GSI

Only for GSI, if "ro.vndk.version" property is not defined, the
vendor modules will use current version of VNDK libs.

Bug: 70704112
Test: On Android-P sailfish device, install GSI and check boot
Change-Id: Ib8eb28604ab3e33474179dffbc07358921e7439c
diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk
index 7ff5acb..c385352 100644
--- a/target/product/treble_common.mk
+++ b/target/product/treble_common.mk
@@ -87,3 +87,7 @@
     system/core/rootdir/etc/ld.config.txt:system/etc/ld.config.noenforce.txt \
     build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc \
     build/make/target/product/vndk/init.noenforce.rc:system/etc/init/gsi/init.noenforce.rc
+
+#Set current VNDK version for GSI
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+    ro.gsi.vndk.version=$(PLATFORM_VNDK_VERSION)
diff --git a/target/product/vndk/init.noenforce.rc b/target/product/vndk/init.noenforce.rc
index 9371cc8..6cf1df7 100644
--- a/target/product/vndk/init.noenforce.rc
+++ b/target/product/vndk/init.noenforce.rc
@@ -1,3 +1,5 @@
 on early-init
     # If ro.vndk.version is not set, use ld.config.nonenforce.txt
     export LD_CONFIG_FILE /system/etc/ld.config.noenforce.txt
+    # To use current VNDK libs, set ro.vndk.version to system vndk version
+    setprop ro.vndk.version ${ro.gsi.vndk.version}