From b2a549bb85a95c326479c2b4ae9eab4a3fbe8118 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 22 May 2019 10:21:21 -0700 Subject: [PATCH 1/2] Add com.google.android.media.effects to missing uses-library list com.google.android.media.effects is no longer built. Bug: 132357300 Test: m Gallery2 Change-Id: I5eeef3ed9f4875aa3c7a9ec1003944605ebe300b --- core/config.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/config.mk b/core/config.mk index 57c1d7a52c..25b90de99e 100644 --- a/core/config.mk +++ b/core/config.mk @@ -1118,8 +1118,11 @@ INTERNAL_PLATFORM_SYSTEM_PRIVATE_DEX_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIAT endif # Missing optional uses-libraries so that the platform doesn't create build rules that depend on -# them. See setup_one_odex.mk. -INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := com.google.android.ble com.google.android.wearable +# them. +INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := \ + com.google.android.ble \ + com.google.android.media.effects \ + com.google.android.wearable \ # This is the standard way to name a directory containing prebuilt target # objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so From 539543990e7ba284f37a5acb2c802cd1eb70129d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 22 May 2019 10:24:31 -0700 Subject: [PATCH 2/2] Don't add dependency on missing optional shared libraries Filter out LOCAL_OPTIONAL_USES_LIBRARIES entries that are listed in INTERNAL_PLATFORM_MISSING_USES_LIBRARIES before using them as a dependency. Bug: 132357300 Test: m Gallery2 Change-Id: I09bf331f7dc95d1aaa8e5176603bcd343dd93001 --- core/dex_preopt_odex_install.mk | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 266ebd25f7..152962bcbb 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -183,6 +183,22 @@ ifdef LOCAL_DEX_PREOPT endif # TARGET_2ND_ARCH endif # LOCAL_MODULE_CLASS + my_filtered_optional_uses_libraries := $(filter-out $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES), \ + $(LOCAL_OPTIONAL_USES_LIBRARIES)) + + # dexpreopt needs the paths to the dex jars of these libraries in case + # construct_context.sh needs to pass them to dex2oat. + my_extra_dexpreopt_libs := \ + org.apache.http.legacy \ + android.hidl.base-V1.0-java \ + android.hidl.manager-V1.0-java \ + + my_dexpreopt_libs := $(sort \ + $(LOCAL_USES_LIBRARIES) \ + $(my_filtered_optional_uses_libraries) \ + $(my_extra_dexpreopt_libs) \ + ) + # Record dex-preopt config. DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT) DEXPREOPT.$(LOCAL_MODULE).MULTILIB := $(LOCAL_MULTILIB) @@ -213,7 +229,7 @@ ifdef LOCAL_DEX_PREOPT $(call add_json_list, OptionalUsesLibraries, $(LOCAL_OPTIONAL_USES_LIBRARIES)) $(call add_json_list, UsesLibraries, $(LOCAL_USES_LIBRARIES)) $(call add_json_map, LibraryPaths) - $(foreach lib,$(sort $(LOCAL_USES_LIBRARIES) $(LOCAL_OPTIONAL_USES_LIBRARIES) org.apache.http.legacy android.hidl.base-V1.0-java android.hidl.manager-V1.0-java),\ + $(foreach lib,$(my_dexpreopt_libs),\ $(call add_json_str, $(lib), $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar)) $(call end_json_map) $(call add_json_list, Archs, $(my_dexpreopt_archs)) @@ -256,7 +272,7 @@ ifdef LOCAL_DEX_PREOPT my_dexpreopt_deps := $(my_dex_jar) my_dexpreopt_deps += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE)) my_dexpreopt_deps += \ - $(foreach lib,$(sort $(LOCAL_USES_LIBRARIES) $(LOCAL_OPTIONAL_USES_LIBRARIES) org.apache.http.legacy android.hidl.base-V1.0-java android.hidl.manager-V1.0-java),\ + $(foreach lib, $(my_dexpreopt_libs), \ $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar) my_dexpreopt_deps += $(my_dexpreopt_images) my_dexpreopt_deps += $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)