Add a helper class OfaContext for OatFileAssistant.

OfaContext fetches and caches information including boot image
checksums, bootclasspath checksums, and APEX versions.

This change eliminates the unnecessary reads of the art files,
oat files, and dex files in the slow path of app oat header validation
on app startup. After this change, there is no longer a "fast path" and
a "slow path". Instead, OfaContext always gets the boot image checksums
and BCP checksums from the runtime. (Trace before:
http://screen/6CPziPGmG92Mrw2, Trace after:
http://screen/gzpUEcJ3R78fWiJ)

OfaContext can be kept on the caller side so that the cache can be
reused, making callers like artd faster on repetitive calls to
OatFileAssistant. After this change, calling Artd::getOptimizationStatus
100 times takes 600ms less total time. For example, running
`adb shell pm art get-optimization-status com.google.android.youtube`
100 times took 3.2s on average on Cuttlefish before this change, but now
takes 2.6s after this change.

In addition, after this change, the responsibilities of
OatFileAssistant and ImageSpace are divided in a better way. ImageSpace
is purely responsible for loading and validating boot images. It is no
longer responsible for validating app oat headers. Instead, this
responsibility is now taken by OatFileAssistant.

`--validate-bcp` is removed from dexoptanalyzer because no one is using
it.

Bug: 238394854
Bug: 229268202
Test: m test-art-host-gtest-art_runtime_tests
Test: atest ArtGtestsTargetChroot
Test: art/test.py --host -r
Test: atest art_standalone_dexpreopt_tests
Test: atest odsign_e2e_tests_full
Ignore-AOSP-First: Contains internal only changes. Will cherry-pick the
  AOSP part later.
Change-Id: I83b43684d78c91e649300929ca2f348c626e1cab
17 files changed