Search in sources :

Example 21 with CrashlyticsReportWithSessionId

use of com.google.firebase.crashlytics.internal.common.CrashlyticsReportWithSessionId in project GreenHouse by utsanjan.

the class CrashlyticsReportPersistence method loadFinalizedReports.

public List<CrashlyticsReportWithSessionId> loadFinalizedReports() {
    List<File> allReportFiles = getAllFinalizedReportFiles();
    ArrayList<CrashlyticsReportWithSessionId> allReports = new ArrayList<>();
    allReports.ensureCapacity(allReportFiles.size());
    for (File reportFile : getAllFinalizedReportFiles()) {
        try {
            CrashlyticsReport jsonReport = TRANSFORM.reportFromJson(readTextFile(reportFile));
            allReports.add(CrashlyticsReportWithSessionId.create(jsonReport, reportFile.getName()));
        } catch (IOException e) {
            Logger logger = Logger.getLogger();
            logger.d("Could not load report file " + reportFile + "; deleting", e);
            reportFile.delete();
        }
    }
    return allReports;
}
Also used : CrashlyticsReport(com.google.firebase.crashlytics.internal.model.CrashlyticsReport) ArrayList(java.util.ArrayList) CrashlyticsReportWithSessionId(com.google.firebase.crashlytics.internal.common.CrashlyticsReportWithSessionId) IOException(java.io.IOException) Logger(com.google.firebase.crashlytics.internal.Logger) File(java.io.File)

Aggregations

CrashlyticsReportWithSessionId (com.google.firebase.crashlytics.internal.common.CrashlyticsReportWithSessionId)21 CrashlyticsReport (com.google.firebase.crashlytics.internal.model.CrashlyticsReport)14 Event (com.google.firebase.crashlytics.internal.model.CrashlyticsReport.Session.Event)8 Session (com.google.firebase.crashlytics.internal.model.CrashlyticsReport.Session)7 ArrayList (java.util.ArrayList)4 ExecutionException (java.util.concurrent.ExecutionException)3 Test (org.junit.Test)3 NonNull (androidx.annotation.NonNull)2 TaskCompletionSource (com.google.android.gms.tasks.TaskCompletionSource)2 Settings (com.google.firebase.crashlytics.internal.settings.Settings)2 FeatureFlagData (com.google.firebase.crashlytics.internal.settings.Settings.FeatureFlagData)2 SettingsProvider (com.google.firebase.crashlytics.internal.settings.SettingsProvider)2 File (java.io.File)2 IOException (java.io.IOException)2 DecimalFormat (java.text.DecimalFormat)2 Logger (com.google.firebase.crashlytics.internal.Logger)1 HashSet (java.util.HashSet)1