Use sysprop stub regarding to the install location
Rather than the owner of sysprop, the install location is important when
choosing a stub for sysprop_library.
Bug: 171170584
Test: soong test
Change-Id: Iba934d14dd235bd85d0bd631ef6bad83c1b4f551
diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go
index 711129c..3be1945 100644
--- a/sysprop/sysprop_test.go
+++ b/sysprop/sysprop_test.go
@@ -103,6 +103,8 @@
"api/sysprop-platform-on-product-latest.txt": nil,
"api/sysprop-vendor-current.txt": nil,
"api/sysprop-vendor-latest.txt": nil,
+ "api/sysprop-vendor-on-product-current.txt": nil,
+ "api/sysprop-vendor-on-product-latest.txt": nil,
"api/sysprop-odm-current.txt": nil,
"api/sysprop-odm-latest.txt": nil,
"framework/aidl/a.aidl": nil,
@@ -182,8 +184,15 @@
srcs: ["com/android/VendorProperties.sysprop"],
api_packages: ["com.android"],
property_owner: "Vendor",
+ vendor: true,
+ }
+
+ sysprop_library {
+ name: "sysprop-vendor-on-product",
+ srcs: ["com/android/VendorProperties.sysprop"],
+ api_packages: ["com.android"],
+ property_owner: "Vendor",
product_specific: true,
- vendor_available: true,
}
sysprop_library {
@@ -213,7 +222,7 @@
srcs: ["c.java"],
sdk_version: "system_current",
product_specific: true,
- libs: ["sysprop-platform", "sysprop-vendor"],
+ libs: ["sysprop-platform", "sysprop-vendor-on-product"],
}
java_library {
@@ -240,7 +249,7 @@
name: "cc-client-product",
srcs: ["d.cpp"],
product_specific: true,
- static_libs: ["sysprop-platform-on-product", "sysprop-vendor"],
+ static_libs: ["sysprop-platform-on-product", "sysprop-vendor-on-product"],
}
cc_library {
@@ -290,6 +299,12 @@
soc_specific: true,
sdk_version: "core_current",
}
+
+ java_library {
+ name: "sysprop-library-stub-product",
+ product_specific: true,
+ sdk_version: "core_current",
+ }
`)
// Check for generated cc_library
@@ -317,13 +332,14 @@
expectedApexAvailableOnLibrary, library.ApexProperties.Apex_available)
}
- // core variant of vendor-owned sysprop_library is for product
- ctx.ModuleForTests("libsysprop-vendor", variant)
+ // product variant of vendor-owned sysprop_library
+ ctx.ModuleForTests("libsysprop-vendor-on-product", variant)
}
ctx.ModuleForTests("sysprop-platform", "android_common")
ctx.ModuleForTests("sysprop-platform_public", "android_common")
ctx.ModuleForTests("sysprop-vendor", "android_common")
+ ctx.ModuleForTests("sysprop-vendor-on-product", "android_common")
// Check for exported includes
coreVariant := "android_arm64_armv8-a_static"
@@ -336,7 +352,7 @@
platformOnProductPath := "libsysprop-platform-on-product/android_arm64_armv8-a_static/gen/sysprop/public/include"
vendorInternalPath := "libsysprop-vendor/android_vendor.VER_arm64_armv8-a_static/gen/sysprop/include"
- vendorPublicPath := "libsysprop-vendor/android_arm64_armv8-a_static/gen/sysprop/public/include"
+ vendorPublicPath := "libsysprop-vendor-on-product/android_arm64_armv8-a_static/gen/sysprop/public/include"
platformClient := ctx.ModuleForTests("cc-client-platform", coreVariant)
platformFlags := platformClient.Rule("cc").Args["cFlags"]