summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMengjun Leng <quic_mengju@quicinc.com>2021-04-09 14:11:22 +0800
committerSarah Chin <sarahchin@google.com>2021-05-12 13:51:33 -0700
commitf98fcd7198930648b4a3bf957052d5bde9ae13bd (patch)
treedba9046eb0d42d8e0342bfb8008dbb04b1f7d64a /tests
parentbd59ecfce736a340904683b8e3c7e62b58ff4794 (diff)
downloadplatform_packages_services_Telephony-f98fcd7198930648b4a3bf957052d5bde9ae13bd.tar.gz
platform_packages_services_Telephony-f98fcd7198930648b4a3bf957052d5bde9ae13bd.tar.bz2
platform_packages_services_Telephony-f98fcd7198930648b4a3bf957052d5bde9ae13bd.zip
Use new APIs from SIM phonebook provider
Bug: 23044962 Change-Id: I2880e7e210d84959205c3c4e214f879a37f665fc
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/phone/SimPhonebookProviderTest.java37
1 files changed, 24 insertions, 13 deletions
diff --git a/tests/src/com/android/phone/SimPhonebookProviderTest.java b/tests/src/com/android/phone/SimPhonebookProviderTest.java
index 4ab92a762..f897fac43 100644
--- a/tests/src/com/android/phone/SimPhonebookProviderTest.java
+++ b/tests/src/com/android/phone/SimPhonebookProviderTest.java
@@ -51,6 +51,7 @@ import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.provider.ProviderTestRule;
import com.android.internal.telephony.IIccPhoneBook;
+import com.android.internal.telephony.uicc.AdnCapacity;
import com.android.internal.telephony.uicc.AdnRecord;
import com.android.internal.telephony.uicc.IccConstants;
@@ -1394,15 +1395,18 @@ public final class SimPhonebookProviderTest {
}
@Override
- public boolean updateAdnRecordsInEfBySearch(int efid, String oldTag, String oldPhoneNumber,
- String newTag, String newPhoneNumber, String pin2) {
- return updateAdnRecordsInEfBySearchForSubscriber(
- mDefaultSubscriptionId, efid,
- oldTag, oldPhoneNumber, newTag, newPhoneNumber, pin2);
+ public boolean updateAdnRecordsInEfBySearchForSubscriber(int subId, int efid,
+ ContentValues values, String pin2) {
+ final String oldTag = values.getAsString(IccProvider.STR_TAG);
+ final String oldPhoneNumber = values.getAsString(IccProvider.STR_NUMBER);
+ final String newTag = values.getAsString(IccProvider.STR_NEW_TAG);
+ final String newPhoneNumber = values.getAsString(IccProvider.STR_NEW_NUMBER);
+ return updateAdnRecordsInEfBySearchForSubscriber(subId, efid, oldTag, oldPhoneNumber,
+ newTag, newPhoneNumber, pin2);
+
}
- @Override
- public boolean updateAdnRecordsInEfBySearchForSubscriber(int subId, int efid, String oldTag,
+ private boolean updateAdnRecordsInEfBySearchForSubscriber(int subId, int efid, String oldTag,
String oldPhoneNumber, String newTag, String newPhoneNumber, String pin2) {
if (!oldTag.isEmpty() || !oldPhoneNumber.isEmpty()) {
throw new IllegalArgumentException(
@@ -1413,14 +1417,16 @@ public final class SimPhonebookProviderTest {
}
@Override
- public boolean updateAdnRecordsInEfByIndex(int efid, String newTag, String newPhoneNumber,
- int index, String pin2) {
- return updateAdnRecordsInEfByIndexForSubscriber(mDefaultSubscriptionId,
- efid, newTag, newPhoneNumber, index, pin2);
+ public boolean updateAdnRecordsInEfByIndexForSubscriber(int subId, int efid,
+ ContentValues values, int index, String pin2) {
+ final String newTag = values.getAsString(IccProvider.STR_NEW_TAG);
+ final String newPhoneNumber = values.getAsString(IccProvider.STR_NEW_NUMBER);
+ return updateAdnRecordsInEfByIndexForSubscriber(subId, efid, newTag, newPhoneNumber,
+ index, pin2);
+
}
- @Override
- public boolean updateAdnRecordsInEfByIndexForSubscriber(int subId, int efid, String newTag,
+ private boolean updateAdnRecordsInEfByIndexForSubscriber(int subId, int efid, String newTag,
String newPhoneNumber, int index, String pin2) {
AdnRecord[] records = mRecords.computeIfAbsent(Pair.create(subId, efid), unused ->
createEmptyRecords(efid, 100));
@@ -1443,6 +1449,11 @@ public final class SimPhonebookProviderTest {
int count = mRecords.get(key).length;
return new int[]{recordSize, recordSize * count, count};
}
+
+ @Override
+ public AdnCapacity getAdnRecordsCapacityForSubscriber(int subId) {
+ return new AdnCapacity(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ }
}
/**