/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/ContactsBackend.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

Lines of Context:
58
58
                {
59
59
                        switch( type )
60
60
                        {
61
 
                        case Contacts.Phones.TYPE_MOBILE:
 
61
                        case Contacts.PhonesColumns.TYPE_MOBILE:
62
62
                                return ContactData.TYPE_MOBILE;
63
 
                        case Contacts.Phones.TYPE_FAX_HOME:
 
63
                        case Contacts.PhonesColumns.TYPE_FAX_HOME:
64
64
                                return ContactData.TYPE_FAX_HOME;
65
 
                        case Contacts.Phones.TYPE_FAX_WORK:
 
65
                        case Contacts.PhonesColumns.TYPE_FAX_WORK:
66
66
                                return ContactData.TYPE_FAX_WORK;
67
 
                        case Contacts.Phones.TYPE_PAGER:
 
67
                        case Contacts.PhonesColumns.TYPE_PAGER:
68
68
                                return ContactData.TYPE_PAGER;
69
 
                        case Contacts.Phones.TYPE_WORK:
 
69
                        case Contacts.PhonesColumns.TYPE_WORK:
70
70
                                return ContactData.TYPE_WORK;
71
71
                        default:
72
72
                                return ContactData.TYPE_HOME;
76
76
                {
77
77
                        switch( type )
78
78
                        {
79
 
                        case Contacts.Phones.TYPE_WORK:
 
79
                        case Contacts.ContactMethodsColumns.TYPE_WORK:
80
80
                                return ContactData.TYPE_WORK;
81
81
                        default:
82
82
                                return ContactData.TYPE_HOME;
115
115
                        _cur.getString( _cur.getColumnIndex( Contacts.People.NAME ) ) );
116
116
 
117
117
                // add notes
118
 
                contact.addNote(
119
 
                        _cur.getString( _cur.getColumnIndex( Contacts.People.NOTES ) ) );
 
118
                String note = _cur.getString(
 
119
                        _cur.getColumnIndex( Contacts.People.NOTES ) );
 
120
                if( note != null && note.length() > 0 )
 
121
                        contact.addNote( note );
120
122
 
121
123
                // add the organisations
122
124
                Cursor cur = _activity.managedQuery( Contacts.Organizations.CONTENT_URI,