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_library.go b/sysprop/sysprop_library.go
index 480f9b7..edb8b30 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -404,13 +404,21 @@
 	// ctx's Platform or Specific functions represent where this sysprop_library installed.
 	installedInSystem := ctx.Platform() || ctx.SystemExtSpecific()
 	installedInVendorOrOdm := ctx.SocSpecific() || ctx.DeviceSpecific()
+	installedInProduct := ctx.ProductSpecific()
 	isOwnerPlatform := false
-	stub := "sysprop-library-stub-"
+	var stub string
+
+	if installedInVendorOrOdm {
+		stub = "sysprop-library-stub-vendor"
+	} else if installedInProduct {
+		stub = "sysprop-library-stub-product"
+	} else {
+		stub = "sysprop-library-stub-platform"
+	}
 
 	switch m.Owner() {
 	case "Platform":
 		// Every partition can access platform-defined properties
-		stub += "platform"
 		isOwnerPlatform = true
 	case "Vendor":
 		// System can't access vendor's properties
@@ -418,14 +426,12 @@
 			ctx.ModuleErrorf("None of soc_specific, device_specific, product_specific is true. " +
 				"System can't access sysprop_library owned by Vendor")
 		}
-		stub += "vendor"
 	case "Odm":
 		// Only vendor can access Odm-defined properties
 		if !installedInVendorOrOdm {
 			ctx.ModuleErrorf("Neither soc_speicifc nor device_specific is true. " +
 				"Odm-defined properties should be accessed only in Vendor or Odm")
 		}
-		stub += "vendor"
 	default:
 		ctx.PropertyErrorf("property_owner",
 			"Unknown value %s: must be one of Platform, Vendor or Odm", m.Owner())