PackageManager: Avoid unnecessary calls to derivePackageAbi during boot scans

In most cases, we can safely use the values from package settings instead.
We do the work when we're in the middle of an upgrade or the first boot,
since we have no choice.

This saves about 200-400ms on package manager startup on a freshly wiped
device with no app installs. Savings are likely to grow linearly with
the number of installed apps.

Bug: 22063656
Test: make + manual testing.

Change-Id: I1b2bdc4df45f334620c1fb94d78276f0095d5ff8
2 files changed