Only madvise primary oat/vdex artifacts

Suppress madvise calls to non-primary vdex/oat files whenever possible.
Note that this suppression relies on AppInfo registration happening
relatively early in the app lifecycle, which is generally the case.
Until the registration is made, we madvise these artifacts as is
done with the current behavior.

This should avoid cases during app startup where Dynamite-like
dependencies (e.g., for GMS Core) currently trigger a full madvise
of all dependent vdex/oat files, which is generally unnecessary
and potentially wasteful for such cases.

Note that this change moves the oat madvise call out of OatFile's
constructor into OpenDexFilesFromOat. This makes it easier to reason
about ordering relative to other madvise calls (for dex/vdex), but
should be almost identical in terms of timing.

A/B perf tests shows that this slightly improves app startup time
across a suite of apps, with apps that don't load secondary APKs/dex
files not being impacted at all.

Bug: 235130726
Test: m + flash and verify GMS vdex/oat files not madvised by apps
Merged-In: I41374d5ae9f91f39e399ac21615a821307c56b6e
Change-Id: I41374d5ae9f91f39e399ac21615a821307c56b6e
5 files changed