/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-20 12:28:40 UTC
  • Revision ID: tim@ed.am-20121220122840-b097yla5spgx5h6q
fixed selection of raw contacts in ContactsContract backend

Show diffs side-by-side

added added

removed removed

Lines of Context:
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,
309
310
                        },
310
 
                        ContactsContract.RawContacts.DELETED + " != 0 AND " +
 
311
                        ContactsContract.RawContacts.DELETED + " = 0 AND " +
 
312
                                ContactsContract.RawContacts.CONTACT_ID + " = ? AND " +
311
313
                                "IFNULL( " + ContactsContract.RawContacts.ACCOUNT_NAME +
312
314
                                        ", '' ) = '' AND " +
313
315
                                "IFNULL( " + ContactsContract.RawContacts.ACCOUNT_TYPE +
314
316
                                        ", '' ) = ''",
315
 
                        null, null );
 
317
                        new String[] {
 
318
                                String.valueOf( id ),
 
319
                        }, null );
316
320
                if( cur.moveToNext() )
317
321
                        raw_id = cur.getLong(
318
322
                                cur.getColumnIndex( ContactsContract.RawContacts._ID ) );