Merge "Remove services, wifi, ethernet from BOOTCLASSPATH." into lmp-dev
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 76fc130..8a19b66 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -10,6 +10,8 @@
 DEXPREOPT_BOOT_JARS_MODULES := $(PRODUCT_BOOT_JARS)
 PRODUCT_BOOTCLASSPATH := $(subst $(space),:,$(foreach m,$(DEXPREOPT_BOOT_JARS_MODULES),/system/framework/$(m).jar))
 
+PRODUCT_SYSTEM_SERVER_CLASSPATH := $(subst $(space),:,$(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),/system/framework/$(m).jar))
+
 DEXPREOPT_BUILD_DIR := $(OUT_DIR)
 DEXPREOPT_PRODUCT_DIR_FULL_PATH := $(PRODUCT_OUT)/dex_bootjars
 DEXPREOPT_PRODUCT_DIR := $(patsubst $(DEXPREOPT_BUILD_DIR)/%,%,$(DEXPREOPT_PRODUCT_DIR_FULL_PATH))
diff --git a/core/product.mk b/core/product.mk
index c9e22eb..90d5851 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -103,6 +103,7 @@
     PRODUCT_SUPPORTS_VERITY \
     PRODUCT_OEM_PROPERTIES \
     PRODUCT_SYSTEM_PROPERTY_BLACKLIST \
+    PRODUCT_SYSTEM_SERVER_JARS \
     PRODUCT_VERITY_SIGNING_KEY \
     PRODUCT_SYSTEM_VERITY_PARTITION \
     PRODUCT_VENDOR_VERITY_PARTITION
@@ -217,6 +218,7 @@
 
 _product_stash_var_list := $(_product_var_list) \
 	PRODUCT_BOOTCLASSPATH \
+	PRODUCT_SYSTEM_SERVER_CLASSPATH \
 	TARGET_ARCH \
 	TARGET_ARCH_VARIANT \
 	TARGET_CPU_VARIANT \
diff --git a/core/product_config.mk b/core/product_config.mk
index 261b935..48f47eb 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -281,6 +281,7 @@
 
 # A list of module names of BOOTCLASSPATH (jar files)
 PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS))
+PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS))
 
 # Find the device that this product maps to.
 TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
index 880a0fd..e4eb56a 100644
--- a/target/product/core_minimal.mk
+++ b/target/product/core_minimal.mk
@@ -91,8 +91,11 @@
     ims-common \
     mms-common \
     android.policy \
-    services \
     apache-xml \
+
+# The order of PRODUCT_SYSTEM_SERVER_JARS matters.
+PRODUCT_SYSTEM_SERVER_JARS := \
+    services \
     ethernet-service \
     wifi-service
 
diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk
index d6e4dc5..d6dbe98 100644
--- a/target/product/core_tiny.mk
+++ b/target/product/core_tiny.mk
@@ -92,9 +92,12 @@
     ims-common \
     mms-common \
     android.policy \
-    services \
     apache-xml \
     nullwebview \
+
+# The order of PRODUCT_SYSTEM_SERVER_JARS matters.
+PRODUCT_SYSTEM_SERVER_JARS := \
+    services \
     wifi-service
 
 PRODUCT_RUNTIMES := runtime_libart_default