Merge "Skip carrier priv check for trusted UIDs" into rvc-dev am: f1a6972937 am: a9d9ea8a3e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12141306

Change-Id: Iacee9cf6860df0bde8ba367b0085151813909465
This commit is contained in:
Hall Liu
2020-07-14 00:01:15 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 1 deletions

View File

@@ -8178,7 +8178,7 @@ public abstract class PackageManager {
private static final PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>
sPackageInfoCache =
new PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>(
16, PermissionManager.CACHE_KEY_PACKAGE_INFO) {
32, PermissionManager.CACHE_KEY_PACKAGE_INFO) {
@Override
protected PackageInfo recompute(PackageInfoQuery query) {
return getPackageInfoAsUserUncached(

View File

@@ -623,6 +623,10 @@ public final class TelephonyPermissions {
}
private static int getCarrierPrivilegeStatus(Context context, int subId, int uid) {
if (uid == Process.SYSTEM_UID || uid == Process.PHONE_UID) {
// Skip the check if it's one of these special uids
return TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
}
final long identity = Binder.clearCallingIdentity();
try {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(