Merge "Allow all carriers to access BlockedNumberProvider." into qt-dev am: eb10b149a1 am: 285bb7c401
am: 3d04576cc5
Change-Id: I1236e955a00bbf87202c84754063688a8d899bd2
diff --git a/src/com/android/providers/blockednumber/BlockedNumberProvider.java b/src/com/android/providers/blockednumber/BlockedNumberProvider.java
index 68a8c65..2e029d8 100644
--- a/src/com/android/providers/blockednumber/BlockedNumberProvider.java
+++ b/src/com/android/providers/blockednumber/BlockedNumberProvider.java
@@ -632,7 +632,7 @@
final TelephonyManager telephonyManager =
getContext().getSystemService(TelephonyManager.class);
- return telephonyManager.checkCarrierPrivilegesForPackage(callingPackage) ==
+ return telephonyManager.checkCarrierPrivilegesForPackageAnyPhone(callingPackage) ==
TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
}
return false;
diff --git a/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java b/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
index 828028f..8b5e82b 100644
--- a/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
+++ b/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
@@ -479,7 +479,7 @@
public void testCarrierAppCanAccessApis() {
doReturn(PackageManager.PERMISSION_DENIED)
.when(mMockContext).checkCallingPermission(anyString());
- when(mMockContext.mTelephonyManager.checkCarrierPrivilegesForPackage(anyString()))
+ when(mMockContext.mTelephonyManager.checkCarrierPrivilegesForPackageAnyPhone(anyString()))
.thenReturn(TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS);
mResolver.insert(
@@ -489,7 +489,7 @@
// Dialer check is executed twice: once for insert, and once for isBlocked.
verify(mMockContext.mTelephonyManager, times(2))
- .checkCarrierPrivilegesForPackage(anyString());
+ .checkCarrierPrivilegesForPackageAnyPhone(anyString());
}
public void testSelfCanAccessApis() {