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

  • Committer: edam
  • Date: 2011-06-11 12:15:09 UTC
  • Revision ID: edam@waxworlds.org-20110611121509-7ntgiu8fm43ral19
- bump version no. to 1.2
- fix header comment
- added support for LABEL fields

Show diffs side-by-side

added added

removed removed

568
568
 
569
569
                                // determine whether we care about this entry
570
570
                                final HashSet< String > interesting_fields =
571
 
                                        new HashSet< String >( Arrays.asList( new String[]
572
 
                                                { "N", "FN", "ORG", "TITLE", "TEL", "EMAIL", "ADR" }
 
571
                                        new HashSet< String >( Arrays.asList( new String[] { "N",
 
572
                                                "FN", "ORG", "TITLE", "TEL", "EMAIL", "ADR", "LABEL" }
573
573
                                ) );
574
574
                                boolean is_interesting_field =
575
575
                                        interesting_fields.contains( name_param_parts[ 0 ] );
676
676
                                        parseEMAIL( name_param_parts, complete_value );
677
677
                                else if( name_param_parts[ 0 ].equals( "ADR" ) )
678
678
                                        parseADR( name_param_parts, complete_value );
 
679
                                else if( name_param_parts[ 0 ].equals( "LABEL" ) )
 
680
                                        parseLABEL( name_param_parts, complete_value );
679
681
                        }
680
682
                }
681
683
 
933
935
                                }
934
936
 
935
937
                        Set< String > types = extractTypes( params, Arrays.asList(
936
 
                                "PREF", "WORK", "HOME", "INTERNET" ) );
 
938
                                "PREF", "WORK", "HOME" ) );
 
939
 
 
940
                        // add address
 
941
                        int type;
 
942
                        if( types.contains( "WORK" ) )
 
943
                                type = Contacts.ContactMethods.TYPE_WORK;
 
944
                        else
 
945
                                type = Contacts.ContactMethods.TYPE_HOME;
 
946
 
 
947
                        addAddress( unescapeValue( value ), type );
 
948
                }
 
949
 
 
950
                private void parseLABEL( String[] params, String value )
 
951
                {
 
952
                        Set< String > types = extractTypes( params, Arrays.asList(
 
953
                                "PREF", "WORK", "HOME" ) );
937
954
 
938
955
                        // add address
939
956
                        int type;