Loading telephony/common/com/android/internal/telephony/TelephonyPermissions.java +16 −5 Original line number Diff line number Diff line Loading @@ -308,6 +308,12 @@ public final class TelephonyPermissions { return checkPrivilegedReadPermissionOrCarrierPrivilegePermission( context, subId, callingPackage, callingFeatureId, message, false, reportFailure); } private static void throwSecurityExceptionAsUidDoesNotHaveAccess(String message, int uid) { throw new SecurityException(message + ": The uid " + uid + " does not meet the requirements to access device identifiers."); } /** * Checks whether the app with the given pid/uid can read device identifiers. * Loading Loading @@ -343,10 +349,15 @@ public final class TelephonyPermissions { LegacyPermissionManager permissionManager = (LegacyPermissionManager) context.getSystemService(Context.LEGACY_PERMISSION_SERVICE); if (permissionManager.checkDeviceIdentifierAccess(callingPackage, message, callingFeatureId, try { if (permissionManager.checkDeviceIdentifierAccess(callingPackage, message, callingFeatureId, pid, uid) == PackageManager.PERMISSION_GRANTED) { return true; } } catch (SecurityException se) { throwSecurityExceptionAsUidDoesNotHaveAccess(message, uid); } if (reportFailure) { return reportAccessDeniedToReadIdentifiers(context, subId, pid, uid, callingPackage, Loading Loading @@ -410,8 +421,8 @@ public final class TelephonyPermissions { return false; } } throw new SecurityException(message + ": The user " + uid + " does not meet the requirements to access device identifiers."); throwSecurityExceptionAsUidDoesNotHaveAccess(message, uid); return true; } /** Loading Loading
telephony/common/com/android/internal/telephony/TelephonyPermissions.java +16 −5 Original line number Diff line number Diff line Loading @@ -308,6 +308,12 @@ public final class TelephonyPermissions { return checkPrivilegedReadPermissionOrCarrierPrivilegePermission( context, subId, callingPackage, callingFeatureId, message, false, reportFailure); } private static void throwSecurityExceptionAsUidDoesNotHaveAccess(String message, int uid) { throw new SecurityException(message + ": The uid " + uid + " does not meet the requirements to access device identifiers."); } /** * Checks whether the app with the given pid/uid can read device identifiers. * Loading Loading @@ -343,10 +349,15 @@ public final class TelephonyPermissions { LegacyPermissionManager permissionManager = (LegacyPermissionManager) context.getSystemService(Context.LEGACY_PERMISSION_SERVICE); if (permissionManager.checkDeviceIdentifierAccess(callingPackage, message, callingFeatureId, try { if (permissionManager.checkDeviceIdentifierAccess(callingPackage, message, callingFeatureId, pid, uid) == PackageManager.PERMISSION_GRANTED) { return true; } } catch (SecurityException se) { throwSecurityExceptionAsUidDoesNotHaveAccess(message, uid); } if (reportFailure) { return reportAccessDeniedToReadIdentifiers(context, subId, pid, uid, callingPackage, Loading Loading @@ -410,8 +421,8 @@ public final class TelephonyPermissions { return false; } } throw new SecurityException(message + ": The user " + uid + " does not meet the requirements to access device identifiers."); throwSecurityExceptionAsUidDoesNotHaveAccess(message, uid); return true; } /** Loading