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
diff --git a/core/setup_one_odex.mk b/core/setup_one_odex.mk
index 5cc6085..907a379 100644
--- a/core/setup_one_odex.mk
+++ b/core/setup_one_odex.mk
@@ -70,7 +70,7 @@
 
   # 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 @@
   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)