Whitelist package verifiers for bg operation

When spinning up the package verifier at install time, whitelist it for
quiet background operation in a way that is robust to system load &
broadcast queue latency spikes.

Intent-filter (autoVerify) invocation was already being whitelisted in
this way.  This CL adds the latency-insensitive whitelisting to the
PACKAGE_NEEDS_VERIFICATION and PACKAGE_NEEDS_INTEGRITY_VERIFICATION
invocations as well.

Also fix an underlying bug exposed in the course of testing this change:
temp whitelist manipulation during early boot wasn't guarding against
the system's partially-online situation in that phase, so would NPE the
system_server process.  Fixed.

Bug: 156670156
Test: install apps, observe whitelist logging at broadcast dispatch
Test: atest CtsStagedInstallHostTestCases:com.android.tests.stagedinstall.host.StagedInstallTest#testInstallStagedApexAndApk
Change-Id: I1947bbfeac25fa04346be4d3970da032c3e2b022
3 files changed