/android/export-contacts

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

« back to all changes in this revision

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

  • Committer: edam
  • Date: 2012-12-21 15:53:59 UTC
  • Revision ID: tim@ed.am-20121221155359-p8h3n0xhtulmwva0
fixed column values in Contacts backend; don't write-out empty notes; remember to close my queries; switched from wrappers to static valueOf() functions; fix line-endings (should be \r\n)

Show diffs side-by-side

added added

removed removed

140
140
                                ContactsContract.Data.DATA4,
141
141
                        },
142
142
                        ContactsContract.Data.CONTACT_ID + " = ? AND " +
143
 
// column DELTED not found!?
144
 
//                              ContactsContract.Data.DELETED + " = 0 AND " +
 
143
                                ContactsContract.Data.DELETED + " = 0 AND " +
145
144
                                ContactsContract.Data.MIMETYPE + " IN ( ?, ?, ?, ?, ? )",
146
145
                        new String[] {
147
146
                                String.valueOf( id ),
171
170
                        // add email addresses
172
171
                        else if( type.equals( CommonDataKinds.Email.CONTENT_ITEM_TYPE ) )
173
172
                                contact.addEmail( contact.new EmailDetail(
174
 
                                        convertBackendTypeToType( CommonDataKinds.Email.class,
 
173
                                        convertBackendTypeToType( CommonDataKinds.Phone.class,
175
174
                                                cur.getInt( cur.getColumnIndex(
176
175
                                                        CommonDataKinds.Email.TYPE ) ) ),
177
176
                                        cur.getString( cur.getColumnIndex(
180
179
                        // add postal addresses
181
180
                        else if( type.equals( CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE ) )
182
181
                                contact.addAddress( contact.new AddressDetail(
183
 
                                        convertBackendTypeToType( CommonDataKinds.StructuredPostal.class,
 
182
                                        convertBackendTypeToType( CommonDataKinds.Phone.class,
184
183
                                                cur.getInt( cur.getColumnIndex(
185
184
                                                        CommonDataKinds.StructuredPostal.TYPE ) ) ),
186
185
                                        cur.getString( cur.getColumnIndex(