Force LoadBootImage to take APEX versions from an argument.

When a boot image is being loaded, the APEX versions on device are
checked against the APEX versions stored in the boot image. Before this
change, the APEX versions on device were taken from the runtime
instance. However, some tests use LoadBootImage with a bootclasspath
different from the one that the runtime uses, so the APEX versions
calculated by the runtime shouldn't be used. The APEX version check
happened to pass because of many coincidences, but it will no longer
pass once we add core-icu4j and consrypt to the boot image. This CL
fixes the issue with APEX versions, to prepare for the boot image
change.

Bug: 290583827
Test: atest ArtGtestsTargetChroot
Change-Id: Ia7680ac328cf7d996b8fefd1816f1175268918c9
5 files changed