Use Wear specific system server art profile
- Introduces new Sooong namespace art_profile which defines dex pre opt
for wear specific cases
Bug: 269683231
Test: manual
Change-Id: I158bfc6079cff7d7bba719758c01cc22fe3a734b
diff --git a/services/Android.bp b/services/Android.bp
index 7e8333c..8709692 100644
--- a/services/Android.bp
+++ b/services/Android.bp
@@ -150,17 +150,49 @@
srcs: ["core/java/com/android/server/utils/Slogf.java"],
}
+soong_config_module_type {
+ name: "art_profile_java_defaults",
+ module_type: "java_defaults",
+ config_namespace: "art_profile",
+ variables: ["services_profile_path"],
+ properties: ["dex_preopt"],
+}
+
+soong_config_string_variable {
+ name: "services_profile_path",
+ values: ["art_wear_profile"],
+}
+
+art_profile_java_defaults {
+ name: "art_profile_java_defaults",
+ soong_config_variables: {
+ services_profile_path: {
+ art_wear_profile: {
+ dex_preopt: {
+ app_image: true,
+ profile: "art-wear-profile",
+ },
+ },
+ conditions_default: {
+ dex_preopt: {
+ app_image: true,
+ profile: "art-profile",
+ },
+ },
+ },
+ },
+}
+
// merge all required services into one jar
// ============================================================
java_library {
name: "services",
- defaults: ["services_java_defaults"],
+ defaults: [
+ "services_java_defaults",
+ "art_profile_java_defaults",
+ ],
installable: true,
- dex_preopt: {
- app_image: true,
- profile: "art-profile",
- },
exclude_kotlinc_generated_files: true,
srcs: [":services-main-sources"],