From 612917e789e0591dcc73a169ef6c459ff2409403 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 12 Apr 2021 16:15:42 -0300 Subject: [PATCH] Also consider contacts with account 'com.android.contacts' for backup In our tests with CalyxOS, all local contacts had a null account, but for some reason on LineageOS, those contacts have 'com.android.contacts'. So we now consider this as well. --- .../main/java/org/calyxos/backup/contacts/VCardExporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contactsbackup/src/main/java/org/calyxos/backup/contacts/VCardExporter.java b/contactsbackup/src/main/java/org/calyxos/backup/contacts/VCardExporter.java index c83de68e..cb7a5523 100644 --- a/contactsbackup/src/main/java/org/calyxos/backup/contacts/VCardExporter.java +++ b/contactsbackup/src/main/java/org/calyxos/backup/contacts/VCardExporter.java @@ -45,7 +45,7 @@ class VCardExporter { private Collection getLookupKeys() { String[] projection = new String[]{LOOKUP_KEY}; // We can not add IS_PRIMARY here as this gets lost on restored contacts - String selection = ACCOUNT_TYPE + " is null"; + String selection = ACCOUNT_TYPE + " is null OR " + ACCOUNT_TYPE + "='com.android.contacts'"; Cursor cursor = contentResolver.query(CONTENT_URI, projection, selection, null, null); if (cursor == null) { Log.e(TAG, "Cursor for LOOKUP_KEY is null");