Revert "Apply contact updates in batches of 50."

This reverts commit 5d9d6ac12b.
This commit is contained in:
Greyson Parrelli
2019-02-06 00:35:47 -08:00
parent c364345e1d
commit 3683e6a9e2
4 changed files with 7 additions and 95 deletions

View File

@@ -19,7 +19,6 @@ package org.thoughtcrime.securesms.contacts;
import android.accounts.Account;
import android.annotation.SuppressLint;
import android.content.ContentProviderOperation;
import android.content.ContentResolver;
import android.content.Context;
import android.content.OperationApplicationException;
import android.database.Cursor;
@@ -138,7 +137,7 @@ public class ContactsDatabase {
}
if (!operations.isEmpty()) {
applyOperationsInBatches(context.getContentResolver(), ContactsContract.AUTHORITY, operations, 50);
context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operations);
}
}
@@ -533,18 +532,6 @@ public class ContactsDatabase {
}
}
private void applyOperationsInBatches(@NonNull ContentResolver contentResolver,
@NonNull String authority,
@NonNull List<ContentProviderOperation> operations,
int batchSize)
throws OperationApplicationException, RemoteException
{
List<List<ContentProviderOperation>> batches = Util.chunk(operations, batchSize);
for (List<ContentProviderOperation> batch : batches) {
contentResolver.applyBatch(authority, new ArrayList<>(batch));
}
}
private static class ProjectionMappingCursor extends CursorWrapper {
private final Map<String, String> projectionMap;