Replace some PackageInfo queries with PackageState

The motivation is that the current check of preload update
(`packageInfo.signingInfo == null`) seems unstable. PackageState
is also an internal structure and should provide the truth (if not only
closer).

`measurePackage` is used in all cases, and now takes a `PackageState`
instead of `PackageInfo`. The implementation requires referring further
into `AndroidPackage` (which can be null when the APK is missing).

But not all existing code are migrated. For example, MBA requires more
changes in BICS. For those cases, `getPackageStateInternal` serves as an
adapter to get a PackageInfo given package name (from PackageState), so
that we can still use the same `measurePackage`.

Bug: 265244016
Test: No change before and after in the execution of
      `adb shell cmd transparency get apex_info -v`
      `adb shell cmd transparency get module_info -v`
      `adb shell cmd transparency get mba_info -v`
Test: adb shell cmd jobscheduler run android $ID
      With DEBUG == true, logcat output looks correct
Test: atest BinaryTransparencyServiceTest

Change-Id: If898d1ca9bc7020eedf0b05aae87da12a50100e6
2 files changed