Adds scan unit tests

This change adds much needed unit tests to the scanPackageOnlyLI method
in PackageManagerService. As part of the change, the abi-deriving /
parsing code that is heavily device state dependant has been extracted
into an interface that can be mocked.

Test: atest ScanTests
Bug: 137881067
Bug: 137961986
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/7844466

Change-Id: If99330c63658ff21c799712f99c9bb5eba35b960
Merged-In: Ib0b17bffa02570451bd2ad6a649791832c9edd65
9 files changed