flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter. See CALLER_IS_SYNCADAPTER. Type: INTEGER Constant Value: "is_read_only"
When I have apply the above in my code, I am getting -1 as the output for all the contacts. I am using IS_READ_ONLY
to identify the read only contacts synced in WhatsApp, PayTM, Duo, etc.
Cursor curContacts = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
if (curContacts != null) {
while (curContacts.moveToNext()) {
int contactsReadOnly = curContacts.getColumnIndex(ContactsContract.Data.IS_READ_ONLY);
Log.d(Config.TAG, String.valueOf(contactsReadOnly));
}
}
OutPut
-1
-1
-1
Have also tried the below line instead of Data.IS_READ_ONLY
, but the output is same.
int contactsReadOnly = curContacts.getColumnIndex(ContactsContract.RawContacts.RAW_CONTACT_IS_READ_ONLY);