Remove PlatformCompat dependency from getPackageArchiveInfo

It requires a permission which we can't force apps to take to
maintain backwards compatibility. We also arguably cannot because
it leaks visibility, although only for debuggable apps/non-release
builds.

Instead, there's a new static method for getting the raw targetSdk
to gate against and the check is done manually, ignoring
enabled/disabled state. This will cause a mismatch between certain
apps and some system services like AppIntegrityManager, but the
effects should be minimal if we assume that most people ship
valid APKs. At worse the integrity check will pass an APK that
PM will fail, which doesn't break the feature.

Bug: 156356591
Bug: 156778241

Test: manual device boots

Change-Id: I877a5061476b86b9d63c34e75f16b38be8c3e1c2
4 files changed