/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/Importer.java

  • Committer: edam
  • Date: 2012-12-19 17:41:04 UTC
  • Revision ID: tim@ed.am-20121219174104-ly9xyjxdhqt0tu9b
ignore temporary files in eclipse project

Show diffs side-by-side

added added

removed removed

1
1
/*
2
2
 * Importer.java
3
3
 *
4
 
 * Copyright (C) 2009 to 2011 Tim Marston <tim@ed.am>
 
4
 * Copyright (C) 2009 to 2012 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Import Contacts program (hereafter referred
7
7
 * to as "this program"). For more information, see
35
35
import android.os.Message;
36
36
import android.provider.Contacts.PhonesColumns;
37
37
 
38
 
 
39
38
public class Importer extends Thread
40
39
{
41
40
        public final static int ACTION_ABORT = 1;
271
270
                        email = sanitisesEmailAddress( email );
272
271
                        if( email == null )
273
272
                        {
274
 
                                // TODO: warn that an imported email addtrss is being ignored
 
273
                                // TODO: warn that an imported email address is being ignored
275
274
                                return;
276
275
                        }
277
276
 
418
417
                        // update UI
419
418
                        setProgressMessage( R.string.doit_caching );
420
419
 
 
420
                        // create the appropriate backend
421
421
//                      if( Integer.parseInt( android.os.Build.VERSION.SDK ) >= 5 )
422
 
//                              _backend = new ContactsContractBackend();
 
422
//                              _backend = new ContactsContractBackend( _doit );
423
423
//                      else
424
424
                                _backend = new ContactsBackend( _doit );
425
425
 
692
692
                                _backend.deleteContact( id );
693
693
 
694
694
                                // update cache
695
 
                                _contacts_cache.removeLookup( contact.getCacheIdentifier() );
 
695
                                _contacts_cache.removeLookup( cache_identifier );
696
696
                                _contacts_cache.removeAssociatedData( id );
697
697
 
698
698
                                // show that we're overwriting a contact
711
711
                {
712
712
                        // create a new contact
713
713
                        id = _backend.addContact( contact._name );
714
 
                        if( id == null || id <= 0 )
 
714
                        if( id == null )
715
715
                                showError( R.string.error_unabletoaddcontact );
716
716
 
717
717
                        // update cache
718
 
                        _contacts_cache.addLookup(
719
 
                                ContactsCache.createIdentifier( contact ), id );
 
718
                        _contacts_cache.addLookup( cache_identifier, id );
720
719
 
721
720
                        // if we haven't already shown that we're overwriting a contact,
722
721
                        // show that we're creating a new contact