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

  • Committer: Tim Marston
  • Date: 2013-06-22 19:31:44 UTC
  • Revision ID: tim@ed.am-20130622193144-0lo7w92qagow0kmu
minor style tweaks

Show diffs side-by-side

added added

removed removed

4
4
 * Copyright (C) 2011 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Export Contacts program (hereafter referred
7
 
 * to as "this program"). For more information, see
 
7
 * to as "this program").  For more information, see
8
8
 * http://ed.am/dev/android/export-contacts
9
9
 *
10
10
 * This program is free software: you can redistribute it and/or modify
285
285
        protected void exportContacts() throws AbortExportException
286
286
        {
287
287
                // set up a contact reader
288
 
                Backend contact_reader = null;
 
288
                Backend backend = null;
289
289
                if( Integer.parseInt( android.os.Build.VERSION.SDK ) >= 5 )
290
 
                        contact_reader = new ContactsContractBackend( _doit, this );
 
290
                        backend = new ContactsContractBackend( _doit, this );
291
291
                else
292
 
                        contact_reader = new ContactsBackend( _doit, this );
 
292
                        backend = new ContactsBackend( _doit, this );
293
293
 
294
294
                // check we have contacts
295
 
                int num_contacts = contact_reader.getNumContacts();
 
295
                int num_contacts = backend.getNumContacts();
296
296
                if( num_contacts == 0 )
297
297
                        showError( R.string.error_nothingtodo );
298
298
 
308
308
                while( true ) {
309
309
                        checkAbort();
310
310
                        ContactData contact = new ContactData();
311
 
                        if( !contact_reader.getNextContact( contact ) )
 
311
                        if( !backend.getNextContact( contact ) )
312
312
                                break;
313
313
 
314
314
                        // export this one
427
427
                checkAbort();
428
428
                _doit._handler.sendMessage( Message.obtain(
429
429
                        _doit._handler, Doit.MESSAGE_SETMAXPROGRESS,
430
 
                        new Integer( max_progress ) ) );
 
430
                        Integer.valueOf( max_progress ) ) );
431
431
        }
432
432
 
433
433
        protected void setTmpProgress( int tmp_progress )
436
436
                checkAbort();
437
437
                _doit._handler.sendMessage( Message.obtain(
438
438
                        _doit._handler, Doit.MESSAGE_SETTMPPROGRESS,
439
 
                        new Integer( tmp_progress ) ) );
 
439
                        Integer.valueOf( tmp_progress ) ) );
440
440
        }
441
441
 
442
442
        protected void setProgress( int progress ) throws AbortExportException
444
444
                checkAbort();
445
445
                _doit._handler.sendMessage( Message.obtain(
446
446
                        _doit._handler, Doit.MESSAGE_SETPROGRESS,
447
 
                        new Integer( progress ) ) );
 
447
                        Integer.valueOf( progress ) ) );
448
448
        }
449
449
 
450
450
        protected void finish( int action ) throws AbortExportException