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

Commit 2311f61b authored by Ulya Trafimovich's avatar Ulya Trafimovich
Browse files

Fix on-device paths to used libraries in dexpreopt.

Also, add function `install-path-to-on-device-path` that converts
its one argument from on-host install path to on-device path by
stripping PRODUCT_OUT prefix.

Test: lunch aosp_cf_x86_phone-userdebug && m
Test: Cherry-pick in internal master and check that on-device path to
    com.google.android.dialer.support.jar now is on /product partition
    (as it should be) and not on /system:
    $ oatdump \
        --instruction-set=x86 \
        --oat-file=out/target/product/vsoc_x86/product/priv-app/GoogleDialer/oat/x86/GoogleDialer.odex \
      | grep '^classpath' \
      | grep -o '[^[]*com.google.android.dialer.support.jar'
    /product/framework/com.google.android.dialer.support.jar

Bug: 132357300
Change-Id: I9bbe45ffbbed09186ac46e067da7ada599ef9678
parent 1d1bb3b9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -535,6 +535,14 @@ $(strip \
)
endef

###########################################################
## Convert install path to on-device path.
###########################################################
# $(1): install path
define install-path-to-on-device-path
$(patsubst $(PRODUCT_OUT)%,%,$(1))
endef

###########################################################
## The intermediates directory.  Where object files go for
## a given target.  We could technically get away without
+3 −2
Original line number Diff line number Diff line
@@ -235,8 +235,9 @@ ifdef LOCAL_DEX_PREOPT
  $(call add_json_map,  LibraryPaths)
  $(foreach lib,$(my_dexpreopt_libs),\
    $(call add_json_map, $(lib)) \
    $(eval file := $(filter %/$(lib).jar, $(call module-installed-files,$(lib)))) \
    $(call add_json_str, Host,   $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar) \
    $(call add_json_str, Device, /system/framework/$(lib).jar) \
    $(call add_json_str, Device, $(call install-path-to-on-device-path,$(file))) \
    $(call end_json_map))
  $(call end_json_map)
  $(call add_json_list, Archs,                          $(my_dexpreopt_archs))