diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-09 06:26:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-09 06:26:25 +0000 |
commit | aab6dc9f075fd8576ffc78c1f983b8fb1d3e77fa (patch) | |
tree | 3845e7aad9e502bf5a91eb8705c8005f06990105 /java/com/android/dialer/databasepopulator/ContactsPopulator.java | |
parent | 20ebcdca46e6be68050cd44087f0f768f5dae5c6 (diff) | |
parent | 73b51d5771b31c932a589abc9bb0fe64c52fe102 (diff) |
Merge "Implemented adding a new favorites contact flow NUI."
Diffstat (limited to 'java/com/android/dialer/databasepopulator/ContactsPopulator.java')
-rw-r--r-- | java/com/android/dialer/databasepopulator/ContactsPopulator.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/java/com/android/dialer/databasepopulator/ContactsPopulator.java b/java/com/android/dialer/databasepopulator/ContactsPopulator.java index 79492e9d3..f22552db7 100644 --- a/java/com/android/dialer/databasepopulator/ContactsPopulator.java +++ b/java/com/android/dialer/databasepopulator/ContactsPopulator.java @@ -148,6 +148,19 @@ public final class ContactsPopulator { } @WorkerThread + public static void populateSpeedDialTestContacts(@NonNull Context context) { + Assert.isWorkerThread(); + ArrayList<ContentProviderOperation> operations = new ArrayList<>(); + addContact(SIMPLE_CONTACTS[0], operations); + addContact(SIMPLE_CONTACTS[5], operations); + try { + context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operations); + } catch (RemoteException | OperationApplicationException e) { + Assert.fail("error adding contacts: " + e); + } + } + + @WorkerThread public static void populateContacts(@NonNull Context context) { populateContacts(context, false); } |