Remove SdkMemberType.FinalizeModule

This was only being used to set the "stl" property for cc library sdk
member type and so that functionality was moved to AddPrebuiltModule()
and FinalizeModule was removed.

Required a few test changes to move the property to the correct
position in the generated module.

Bug: 142918168
Test: m nothing
Change-Id: If6400189833d4ff3285e7a7adf63a9b509e2a03b
diff --git a/android/sdk.go b/android/sdk.go
index 32d9921..5c7b329 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -356,15 +356,8 @@
 	//   structure and calls AddToPropertySet(...) on the properties struct to add the member
 	//   specific properties in the correct place in the structure.
 	//
-	// * Finally, the FinalizeModule(...) method is called to add any additional properties.
-	//   This was created to allow the property ordering in existing tests to be maintained so
-	//   as to avoid having to change tests while refactoring.
-	//
 	AddPrebuiltModule(sdkModuleContext ModuleContext, builder SnapshotBuilder, member SdkMember) BpModule
 
-	// Add any additional properties to the end of the module.
-	FinalizeModule(sdkModuleContext ModuleContext, builder SnapshotBuilder, member SdkMember, bpModule BpModule)
-
 	// Create a structure into which variant specific properties can be added.
 	CreateVariantPropertiesStruct() SdkMemberProperties
 }
@@ -397,10 +390,6 @@
 	return nil
 }
 
-func (b *SdkMemberTypeBase) FinalizeModule(sdkModuleContext ModuleContext, builder SnapshotBuilder, member SdkMember, module BpModule) {
-	// Do nothing by default
-}
-
 func (b *SdkMemberTypeBase) CreateVariantPropertiesStruct() SdkMemberProperties {
 	panic("override me")
 }
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index f1b0975..843ebb0 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -105,15 +105,12 @@
 	if sdkVersion != "" {
 		pbm.AddProperty("sdk_version", sdkVersion)
 	}
-	return pbm
-}
 
-func (mt *librarySdkMemberType) FinalizeModule(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, member android.SdkMember, bpModule android.BpModule) {
-	ccModule := (member.Variants()[0]).(*Module)
 	stl := ccModule.stl.Properties.Stl
 	if stl != nil {
-		bpModule.AddProperty("stl", proptools.String(stl))
+		pbm.AddProperty("stl", proptools.String(stl))
 	}
+	return pbm
 }
 
 func (mt *librarySdkMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties {
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go
index 0f84c4c..bba111b 100644
--- a/sdk/cc_sdk_test.go
+++ b/sdk/cc_sdk_test.go
@@ -298,6 +298,7 @@
     name: "mysdk_mynativelib@current",
     sdk_member_name: "mynativelib",
     installable: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         arm64: {
@@ -308,12 +309,12 @@
             srcs: ["arm/lib/mynativelib.so"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
     name: "mynativelib",
     prefer: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         arm64: {
@@ -324,7 +325,6 @@
             srcs: ["arm/lib/mynativelib.so"],
         },
     },
-    stl: "none",
 }
 
 sdk_snapshot {
@@ -541,6 +541,7 @@
         "apex2",
     ],
     installable: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         arm64: {
@@ -552,7 +553,6 @@
             export_include_dirs: ["arm/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
@@ -562,6 +562,7 @@
         "apex1",
         "apex2",
     ],
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         arm64: {
@@ -573,7 +574,6 @@
             export_include_dirs: ["arm/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 sdk_snapshot {
@@ -665,6 +665,7 @@
     name: "mysdk_mynativelib@current",
     sdk_member_name: "mynativelib",
     installable: false,
+    stl: "none",
     shared_libs: [
         "mysdk_myothernativelib@current",
         "libc",
@@ -677,12 +678,12 @@
             srcs: ["arm/lib/mynativelib.so"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
     name: "mynativelib",
     prefer: false,
+    stl: "none",
     shared_libs: [
         "myothernativelib",
         "libc",
@@ -695,13 +696,13 @@
             srcs: ["arm/lib/mynativelib.so"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
     name: "mysdk_myothernativelib@current",
     sdk_member_name: "myothernativelib",
     installable: false,
+    stl: "none",
     system_shared_libs: ["libm"],
     arch: {
         arm64: {
@@ -711,12 +712,12 @@
             srcs: ["arm/lib/myothernativelib.so"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
     name: "myothernativelib",
     prefer: false,
+    stl: "none",
     system_shared_libs: ["libm"],
     arch: {
         arm64: {
@@ -726,13 +727,13 @@
             srcs: ["arm/lib/myothernativelib.so"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
     name: "mysdk_mysystemnativelib@current",
     sdk_member_name: "mysystemnativelib",
     installable: false,
+    stl: "none",
     arch: {
         arm64: {
             srcs: ["arm64/lib/mysystemnativelib.so"],
@@ -741,12 +742,12 @@
             srcs: ["arm/lib/mysystemnativelib.so"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
     name: "mysystemnativelib",
     prefer: false,
+    stl: "none",
     arch: {
         arm64: {
             srcs: ["arm64/lib/mysystemnativelib.so"],
@@ -755,7 +756,6 @@
             srcs: ["arm/lib/mysystemnativelib.so"],
         },
     },
-    stl: "none",
 }
 
 sdk_snapshot {
@@ -819,6 +819,7 @@
     host_supported: true,
     installable: false,
     sdk_version: "minimum",
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         x86_64: {
@@ -830,7 +831,6 @@
             export_include_dirs: ["x86/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
@@ -839,6 +839,7 @@
     device_supported: false,
     host_supported: true,
     sdk_version: "minimum",
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         x86_64: {
@@ -850,7 +851,6 @@
             export_include_dirs: ["x86/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 sdk_snapshot {
@@ -918,6 +918,7 @@
     device_supported: false,
     host_supported: true,
     installable: false,
+    stl: "none",
     target: {
         linux_glibc_x86_64: {
             srcs: ["linux_glibc/x86_64/lib/mynativelib.so"],
@@ -929,7 +930,6 @@
             srcs: ["windows/x86_64/lib/mynativelib.dll"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_shared {
@@ -937,6 +937,7 @@
     prefer: false,
     device_supported: false,
     host_supported: true,
+    stl: "none",
     target: {
         linux_glibc_x86_64: {
             srcs: ["linux_glibc/x86_64/lib/mynativelib.so"],
@@ -948,7 +949,6 @@
             srcs: ["windows/x86_64/lib/mynativelib.dll"],
         },
     },
-    stl: "none",
 }
 
 sdk_snapshot {
@@ -996,6 +996,7 @@
     name: "myexports_mynativelib@current",
     sdk_member_name: "mynativelib",
     installable: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         arm64: {
@@ -1007,12 +1008,12 @@
             export_include_dirs: ["arm/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_static {
     name: "mynativelib",
     prefer: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         arm64: {
@@ -1024,7 +1025,6 @@
             export_include_dirs: ["arm/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 module_exports_snapshot {
@@ -1085,6 +1085,7 @@
     device_supported: false,
     host_supported: true,
     installable: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         x86_64: {
@@ -1096,7 +1097,6 @@
             export_include_dirs: ["x86/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_static {
@@ -1104,6 +1104,7 @@
     prefer: false,
     device_supported: false,
     host_supported: true,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         x86_64: {
@@ -1115,7 +1116,6 @@
             export_include_dirs: ["x86/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 module_exports_snapshot {
@@ -1183,6 +1183,7 @@
     device_supported: false,
     host_supported: true,
     installable: false,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         x86_64: {
@@ -1190,7 +1191,6 @@
             export_include_dirs: ["x86_64/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_static {
@@ -1198,6 +1198,7 @@
     prefer: false,
     device_supported: false,
     host_supported: true,
+    stl: "none",
     export_include_dirs: ["include/include"],
     arch: {
         x86_64: {
@@ -1205,7 +1206,6 @@
             export_include_dirs: ["x86_64/include_gen/mynativelib"],
         },
     },
-    stl: "none",
 }
 
 module_exports_snapshot {
@@ -1251,15 +1251,15 @@
 cc_prebuilt_library_headers {
     name: "mysdk_mynativeheaders@current",
     sdk_member_name: "mynativeheaders",
-    export_include_dirs: ["include/include"],
     stl: "none",
+    export_include_dirs: ["include/include"],
 }
 
 cc_prebuilt_library_headers {
     name: "mynativeheaders",
     prefer: false,
-    export_include_dirs: ["include/include"],
     stl: "none",
+    export_include_dirs: ["include/include"],
 }
 
 sdk_snapshot {
@@ -1304,8 +1304,8 @@
     sdk_member_name: "mynativeheaders",
     device_supported: false,
     host_supported: true,
-    export_include_dirs: ["include/include"],
     stl: "none",
+    export_include_dirs: ["include/include"],
 }
 
 cc_prebuilt_library_headers {
@@ -1313,8 +1313,8 @@
     prefer: false,
     device_supported: false,
     host_supported: true,
-    export_include_dirs: ["include/include"],
     stl: "none",
+    export_include_dirs: ["include/include"],
 }
 
 sdk_snapshot {
@@ -1366,6 +1366,7 @@
     name: "mysdk_mynativeheaders@current",
     sdk_member_name: "mynativeheaders",
     host_supported: true,
+    stl: "none",
     export_system_include_dirs: ["include/include"],
     target: {
         android: {
@@ -1375,13 +1376,13 @@
             export_include_dirs: ["include/include-host"],
         },
     },
-    stl: "none",
 }
 
 cc_prebuilt_library_headers {
     name: "mynativeheaders",
     prefer: false,
     host_supported: true,
+    stl: "none",
     export_system_include_dirs: ["include/include"],
     target: {
         android: {
@@ -1391,7 +1392,6 @@
             export_include_dirs: ["include/include-host"],
         },
     },
-    stl: "none",
 }
 
 sdk_snapshot {
diff --git a/sdk/update.go b/sdk/update.go
index a95d06a..bee9c26 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -976,8 +976,6 @@
 			}
 		}
 	}
-
-	memberType.FinalizeModule(sdkModuleContext, builder, member, bpModule)
 }
 
 // Compute the list of possible os types that this sdk could support.