/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/importcontacts/ContactsContractBackend.java

  • Committer: edam
  • Date: 2012-12-19 17:51:35 UTC
  • Revision ID: tim@ed.am-20121219175135-1cpuafp76jg1ib1p
added preliminary (buggy) ContactsContract backend

Show diffs side-by-side

added added

removed removed

75
75
                        new String[] {
76
76
                                ContactsContract.RawContacts._ID,
77
77
                                ContactsContract.RawContacts.CONTACT_ID,
78
 
                        }, ContactsContract.RawContacts.DELETED + " = 0", null, null );
 
78
                        }, ContactsContract.RawContacts.DELETED + " != 0", null, null );
79
79
                while( cur.moveToNext() ) {
80
80
                        Long raw_id = cur.getLong(
81
81
                                cur.getColumnIndex( ContactsContract.RawContacts._ID ) );
306
306
                        ContactsContract.RawContacts.CONTENT_URI,
307
307
                        new String[] {
308
308
                                ContactsContract.RawContacts._ID,
309
 
                                ContactsContract.RawContacts.ACCOUNT_NAME,
310
309
                        },
311
 
                        ContactsContract.RawContacts.DELETED + " = 0 AND " +
312
 
                                ContactsContract.RawContacts.CONTACT_ID + " = ? AND " +
 
310
                        ContactsContract.RawContacts.DELETED + " != 0 AND " +
313
311
                                "IFNULL( " + ContactsContract.RawContacts.ACCOUNT_NAME +
314
312
                                        ", '' ) = '' AND " +
315
313
                                "IFNULL( " + ContactsContract.RawContacts.ACCOUNT_TYPE +
316
314
                                        ", '' ) = ''",
317
 
                        new String[] {
318
 
                                String.valueOf( id ),
319
 
                        }, null );
 
315
                        null, null );
320
316
                if( cur.moveToNext() )
321
317
                        raw_id = cur.getLong(
322
318
                                cur.getColumnIndex( ContactsContract.RawContacts._ID ) );