Hi,
I contribute to development of an open source SMS app.
Since a recent grapheneos stable channel update reading contact data from the contacts provider is broken for our app only under grapheneos.
i also tested this using the default grapheneos messaging app and the default grapheneos contacts app. attach a contact fails in those built-in apps too.
sample kotlin code that will demonstrate the issue (cut pasted from different code areas and not test compiled);
private fun testContactDataProviderAccess(contactData: Uri): Uri {
val lookupKey = context.contentResolver.query(contactData, null, null, null, null)?.use {
it.moveToFirst()
val index = it.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY)
if (index >= 0)
it.getString(index)
else
""
}
val newUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey)
context.contentResolver.openInputStream(newUri)?.use {
val resourceBytes = it.readBytes() // !!! this now reads zero bytes but previously read contact data ok
}
}