Skip carrier priv check for trusted UIDs

Checking carrier privileges for UIDs with lots of shared apps can incur
a significant performance hit. For UIDs that are fixed and trusted
(system and phone), skip the permission check and always allow.

Bug: 160971853
Test: manual verification -- observed lower rate of cache misses for
getPackageInfo from com.android.phone.

Change-Id: Id2079b44a14f67d6b7cccb915424426232d0965a
1 file changed