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.
This commit is contained in:
Torsten Grote 2021-04-12 16:15:42 -03:00 committed by Chirayu Desai
parent d5b32d1410
commit 28f9447317

View file

@ -45,7 +45,7 @@ class VCardExporter {
private Collection<String> 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");