Limit Carrier Privileges to relevant CTS test app

The Android framework queries the SIM card to identify apps that should
have carrier privileges. Currently the emulator's virtual SIM card does
this by providing a certificate hash and any app signed by the matching
certificate will receive carrier privileges. Unfortunately CTS test apps
that have test requiring that they do NOT have carrier privileges are
signed by the same certificate and will fail because they DO have
access. Luckily the framework also supports using package names in
addition to certificate hashes to specify which apps should have
permission. This change adds support for providing such package names
and limits the carrier privileges to the carrier privileges CTS test
app. This revokes privileges from the other test apps and allows those
tests to succeed.

BUG: 33052562
Change-Id: Ie147a1a81d0cc4fd93213022aff7ec83b84d4493
5 files changed