generateRandomContacts
suspend fun generateRandomContacts( numberOfContacts: Int, numberOfPhoneNumbers: Int, numberOfAddress: Int, photos: List<Bitmap>?, asFavorite: Boolean, contactPools: EnumSet<PlatformContactsHelper.ContactPool> = EnumSet.allOf(ContactPool::class.java), seed: Random = Random, onContactGenerated: (Int) -> Unit? = null)
Content copied to clipboard
Generate numberOfContacts contacts with a random name. Each contact is generated with numberOfPhoneNumbers random phone number with random phone type.
Parameters
numberOfContacts
Number of contacts to generate. Should be greater than 0.
numberOfPhoneNumbers
Number of phone numbers per contact. Should be greater than 0.
numberOfAddress
Number of address per contact. Should be greater than 0.
photos
Photos used randomly for the contacts. If null no photo is assigned to contact.
asFavorite
Set to true to generate contacts as favorites instead of as standard contacts.
seed
The random seed to use for generating contacts. Can be omitted for different random contacts each time this is called, and specified for tests to get consistent results.
onContactGenerated
Callback to be called when a single generated contact is added.