/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/org/waxworlds/edam/importcontacts/VCFImporter.java

  • Committer: edam
  • Date: 2010-12-12 11:25:00 UTC
  • Revision ID: edam@waxworlds.org-20101212112500-ml96qi57t0epia2s
- import phone numbers even when they have no specified type (default to mobile)
- allow all keypad chars in a phone number so that network commands can be prefixed to them

Show diffs side-by-side

added added

removed removed

596
596
 
597
597
                        // here's the logic...
598
598
                        boolean preferred = types.contains( "PREF" );
 
599
                        int type = PhonesColumns.TYPE_MOBILE;
599
600
                        if( types.contains( "VOICE" ) )
600
601
                                if( types.contains( "WORK" ) )
601
 
                                        addPhone( value, PhonesColumns.TYPE_WORK, preferred );
 
602
                                        type = PhonesColumns.TYPE_WORK;
602
603
                                else
603
 
                                        addPhone( value, PhonesColumns.TYPE_HOME, preferred );
 
604
                                        type = PhonesColumns.TYPE_HOME;
604
605
                        else if( types.contains( "CELL" ) || types.contains( "VIDEO" ) )
605
 
                                addPhone( value, PhonesColumns.TYPE_MOBILE, preferred );
 
606
                                type = PhonesColumns.TYPE_MOBILE;
606
607
                        if( types.contains( "FAX" ) )
607
608
                                if( types.contains( "HOME" ) )
608
 
                                        addPhone( value, PhonesColumns.TYPE_FAX_HOME, preferred );
 
609
                                        type = PhonesColumns.TYPE_FAX_HOME;
609
610
                                else
610
 
                                        addPhone( value, PhonesColumns.TYPE_FAX_WORK, preferred );
 
611
                                        type = PhonesColumns.TYPE_FAX_WORK;
611
612
                        if( types.contains( "PAGER" ) )
612
 
                                addPhone( value, PhonesColumns.TYPE_PAGER, preferred );
 
613
                                type = PhonesColumns.TYPE_PAGER;
 
614
 
 
615
                        // add phone number
 
616
                        addPhone( value, type, preferred );
613
617
                }
614
618
 
615
619
                public void parseEMAIL( String[] params, String value )