src/main/java/org/acra/SendWorker.java
/**
     * Send pending reports.
     *
     * @param context               The application context.
     * @param sendOnlySilentReports Send only reports explicitly declared as SILENT by the developer (sent via {@link ErrorReporter#handleSilentException(Throwable)}.
     */
Send pending reports.

@param context               The application context.
@param sendOnlySilentReports Send only reports explicitly declared as SILENT by the developer (sent via  ErrorReporter#handleSilentException(Throwable).
Send pending reports . @param context The application context . @param sendOnlySilentReports Send only reports explicitly declared as SILENT by the developer ( sent via ErrorReporter#handleSilentException ( Throwable ) .
private void checkAndSendReports(Context context, boolean sendOnlySilentReports) {
        Log.d(LOG_TAG, "#checkAndSendReports - start");
        final CrashReportFinder reportFinder = new CrashReportFinder(context);
        final String[] reportFiles = reportFinder.getCrashReportFiles();
        Arrays.sort(reportFiles);
        int reportsSentCount = 0;
        for (String curFileName : reportFiles) {
            if (sendOnlySilentReports && !fileNameParser.isSilent(curFileName)) {
                continue;
            }
            if (reportsSentCount >= ACRAConstants.MAX_SEND_REPORTS) {
                break; 
            }
            Log.i(LOG_TAG, "Sending file " + curFileName);
            try {
                final CrashReportPersister persister = new CrashReportPersister(context);
                final CrashReportData previousCrashReport = persister.load(curFileName);
                sendCrashReport(previousCrashReport);
                deleteFile(context, curFileName);
            } catch (RuntimeException e) {
                Log.e(ACRA.LOG_TAG, "Failed to send crash reports for " + curFileName, e);
                deleteFile(context, curFileName);
                break; 
            } catch (IOException e) {
                Log.e(ACRA.LOG_TAG, "Failed to load crash report for " + curFileName, e);
                deleteFile(context, curFileName);
                break; 
            } catch (ReportSenderException e) {
                Log.e(ACRA.LOG_TAG, "Failed to send crash report for " + curFileName, e);
                break; 
            }
            reportsSentCount++;
        }
        Log.d(LOG_TAG, "#checkAndSendReports - finish");
    }
private void checkAndSendReports ( Context context , boolean sendOnlySilentReports ) { Log . d ( LOG_TAG , "#checkAndSendReports - start" ) ; final CrashReportFinder reportFinder = new CrashReportFinder ( context ) ; final String [ ] reportFiles = reportFinder . getCrashReportFiles ( ) ; Arrays . sort ( reportFiles ) ; int reportsSentCount = 0 ; for ( String curFileName : reportFiles ) { if ( sendOnlySilentReports && ! fileNameParser . isSilent ( curFileName ) ) { continue ; } if ( reportsSentCount >= ACRAConstants . MAX_SEND_REPORTS ) { break ; } Log . i ( LOG_TAG , "Sending file " + curFileName ) ; try { final CrashReportPersister persister = new CrashReportPersister ( context ) ; final CrashReportData previousCrashReport = persister . load ( curFileName ) ; sendCrashReport ( previousCrashReport ) ; deleteFile ( context , curFileName ) ; } catch ( RuntimeException e ) { Log . e ( ACRA . LOG_TAG , "Failed to send crash reports for " + curFileName , e ) ; deleteFile ( context , curFileName ) ; break ; } catch ( IOException e ) { Log . e ( ACRA . LOG_TAG , "Failed to load crash report for " + curFileName , e ) ; deleteFile ( context , curFileName ) ; break ; } catch ( ReportSenderException e ) { Log . e ( ACRA . LOG_TAG , "Failed to send crash report for " + curFileName , e ) ; break ; } reportsSentCount ++ ; } Log . d ( LOG_TAG , "#checkAndSendReports - finish" ) ; }
Send pending reports.
Send pending reports .
// send only a few reports to avoid overloading the network
 // Something really unexpected happened. Don't try to send any more reports now.
 // Something unexpected happened when reading the crash report. Don't try to send any more reports now.
 // Something stopped the report being sent. Don't try to send any more reports now.
