Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c52de423 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Move back to using COMMON jars for preopt dependencies

There are too many problems when using the stripped jars. One of them
being that the OatFileAssistant can't open the dex files since the
dex location stored in hte oat file is the system partition one.

Bug: 67345922
Bug: 70934104
Test: make
Change-Id: I3812471330ec1d2e3a435f42a3e975de750004ff
parent d350b16d
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ else

  # Calculate system build dependencies based on the filtered libraries.
  my_intermediate_libs := $(foreach lib_name, $(my_lib_names) $(my_filtered_optional_uses_libraries), \
    $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib_name),,)/javalib.jar)
    $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib_name),,COMMON)/javalib.jar)
  my_dex_preopt_system_dependencies := $(my_intermediate_libs)
  my_dex_preopt_class_loader_context := $(call normalize-path-list,$(my_intermediate_libs))

@@ -82,17 +82,13 @@ else
  my_lib_names := $(patsubst org.apache.http.legacy.boot,org.apache.http.legacy,$(my_lib_names))
  my_optional_lib_names := $(patsubst org.apache.http.legacy.boot,org.apache.http.legacy,$(my_optional_lib_names))
  ifeq (,$(filter org.apache.http.legacy,$(my_lib_names) $(my_optional_lib_names)))
    my_conditional_uses_libraries_host := $(call intermediates-dir-for,JAVA_LIBRARIES,org.apache.http.legacy.boot,,)/javalib.jar
    my_conditional_uses_libraries_host := $(call intermediates-dir-for,JAVA_LIBRARIES,org.apache.http.legacy.boot,,COMMON)/javalib.jar
    my_conditional_uses_libraries_target := /system/framework/org.apache.http.legacy.boot.jar
  endif
endif

# Always depend on org.apache.http.legacy.boot since it may get used by dex2oat-one-file for apps
# targetting <SDK 28(P).
my_always_depend_libraries := $(call intermediates-dir-for,JAVA_LIBRARIES,org.apache.http.legacy.boot,,COMMON)/javalib.jar

$(my_built_odex): $(AAPT)
$(my_built_odex): $(my_always_depend_libraries)
$(my_built_odex): $(my_conditional_uses_libraries_host)
$(my_built_odex): $(my_dex_preopt_system_dependencies)
$(my_built_odex): PRIVATE_ENFORCE_USES_LIBRARIES := $(LOCAL_ENFORCE_USES_LIBRARIES)
$(my_built_odex): PRIVATE_CONDITIONAL_USES_LIBRARIES_HOST := $(my_conditional_uses_libraries_host)