/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: Tim Marston
  • Date: 2014-03-02 10:59:21 UTC
  • Revision ID: tim@ed.am-20140302105921-0q7ytfva236xsv8s
removed some unused code, fixed locale warnings and made showContinueOrAbort()
abort implicitly (rather than return false)

Show diffs side-by-side

added added

removed removed

433
433
                        Matcher m = p.matcher( email );
434
434
                        if( m.matches() ) {
435
435
                                String[] bits = email.split( "@" );
436
 
                                return bits[ 0 ] + "@" + bits[ 1 ].toLowerCase( Locale.US );
 
436
                                return bits[ 0 ] + "@" +
 
437
                                        bits[ 1 ].toLowerCase( Locale.ENGLISH );
437
438
                        }
438
439
                        return null;
439
440
                }
543
544
                finish( ACTION_ABORT );
544
545
        }
545
546
 
546
 
        protected void showFatalError( int res ) throws AbortImportException
547
 
        {
548
 
                showFatalError( _doit.getText( res ).toString() );
549
 
        }
550
 
 
551
 
        synchronized protected void showFatalError( String message )
552
 
                        throws AbortImportException
553
 
        {
554
 
                checkAbort();
555
 
                _doit._handler.sendMessage( Message.obtain(
556
 
                        _doit._handler, Doit.MESSAGE_ERROR, message ) );
557
 
                try {
558
 
                        wait();
559
 
                }
560
 
                catch( InterruptedException e ) { }
561
 
 
562
 
                // no need to check if an abortion happened during the wait, we are
563
 
                // about to finish anyway!
564
 
                finish( ACTION_ABORT );
565
 
        }
566
 
 
567
 
        protected boolean showContinue( int res ) throws AbortImportException
568
 
        {
569
 
                return showContinue( _doit.getText( res ).toString() );
570
 
        }
571
 
 
572
 
        synchronized protected boolean showContinue( String message )
 
547
        protected void showContinueOrAbort( int res ) throws AbortImportException
 
548
        {
 
549
                showContinueOrAbort( _doit.getText( res ).toString() );
 
550
        }
 
551
 
 
552
        synchronized protected void showContinueOrAbort( String message )
573
553
                        throws AbortImportException
574
554
        {
575
555
                checkAbort();
580
560
                }
581
561
                catch( InterruptedException e ) { }
582
562
 
583
 
                // check if an abortion happened during the wait
584
 
                checkAbort();
585
 
 
586
 
                return _response == RESPONSE_POSITIVE;
 
563
                // if we're aborting, there's no need to check if an abortion happened
 
564
                // during the wait
 
565
                if( _response == RESPONSE_NEGATIVE )
 
566
                        finish( ACTION_ABORT );
 
567
                else
 
568
                        checkAbort();
587
569
        }
588
570
 
589
571
        protected void setProgressMessage( int res ) throws AbortImportException