create video call mimetype for raw contacts links

This commit is contained in:
Ehren Kret
2024-05-15 09:21:59 -05:00
committed by Nicholas Tinsley
parent c4e4eaf110
commit 757c0fd2ea
7 changed files with 49 additions and 16 deletions

View File

@@ -17,8 +17,10 @@ class ContactLinkConfiguration(
val appName: String,
val messagePrompt: (String) -> String,
val callPrompt: (String) -> String,
val videoCallPrompt: (String) -> String,
val e164Formatter: (String) -> String,
val messageMimetype: String,
val callMimetype: String,
val videoCallMimetype: String,
val syncTag: String
)

View File

@@ -526,6 +526,16 @@ object SystemContactsRepository {
.withYieldAllowed(true)
.build(),
// Data entry for making a video call
ContentProviderOperation.newInsert(dataUri)
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, operationIndex)
.withValue(ContactsContract.Data.MIMETYPE, linkConfig.videoCallMimetype)
.withValue(ContactsContract.Data.DATA1, systemContactInfo.displayPhone)
.withValue(ContactsContract.Data.DATA2, linkConfig.appName)
.withValue(ContactsContract.Data.DATA3, linkConfig.videoCallPrompt(systemContactInfo.displayPhone))
.withYieldAllowed(true)
.build(),
// Ensures that this RawContact entry is shown next to another RawContact entry we found for this contact
ContentProviderOperation.newUpdate(ContactsContract.AggregationExceptions.CONTENT_URI)
.withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID1, systemContactInfo.siblingRawContactId)