Search in sources :

Example 31 with CrashlyticsReport

use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project firebase-android-sdk by firebase.

the class CrashlyticsReportDataCaptureTest method testCaptureReport_containsUnityVersionInDeveloperPlatformFieldsWhenAvailable.

@Test
public void testCaptureReport_containsUnityVersionInDeveloperPlatformFieldsWhenAvailable() throws Exception {
    final String expectedUnityVersion = "1.0.0";
    when(developmentPlatformProvider.getDevelopmentPlatform()).thenReturn(UNITY_PLATFORM);
    when(developmentPlatformProvider.getDevelopmentPlatformVersion()).thenReturn(expectedUnityVersion);
    initDataCapture();
    final CrashlyticsReport report = dataCapture.captureReportData("sessionId", 0);
    assertNotNull(report.getSession());
    assertEquals(UNITY_PLATFORM, report.getSession().getApp().getDevelopmentPlatform());
    assertEquals(expectedUnityVersion, report.getSession().getApp().getDevelopmentPlatformVersion());
}
Also used : CrashlyticsReport(com.google.firebase.crashlytics.internal.model.CrashlyticsReport) Test(org.junit.Test)

Example 32 with CrashlyticsReport

use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport 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)

Example 33 with CrashlyticsReport

use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.

the class SessionReportingCoordinator method onBeginSession.

// com.google.firebase.crashlytics.internal.common.CrashlyticsLifecycleEvents
@Override
public void onBeginSession(String sessionId, long timestamp) {
    this.currentSessionId = sessionId;
    CrashlyticsReport capturedReport = this.dataCapture.captureReportData(sessionId, timestamp);
    this.reportPersistence.persistReport(capturedReport);
}
Also used : CrashlyticsReport(com.google.firebase.crashlytics.internal.model.CrashlyticsReport)

Example 34 with CrashlyticsReport

use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.

the class AutoValue_CrashlyticsReport method equals.

public boolean equals(Object o) {
    CrashlyticsReport.Session session;
    if (o == this) {
        return true;
    }
    if (!(o instanceof CrashlyticsReport)) {
        return false;
    }
    CrashlyticsReport that = (CrashlyticsReport) o;
    if (this.sdkVersion.equals(that.getSdkVersion()) && this.gmpAppId.equals(that.getGmpAppId()) && this.platform == that.getPlatform() && this.installationUuid.equals(that.getInstallationUuid()) && this.buildVersion.equals(that.getBuildVersion()) && this.displayVersion.equals(that.getDisplayVersion()) && ((session = this.session) != null ? session.equals(that.getSession()) : that.getSession() == null)) {
        CrashlyticsReport.FilesPayload filesPayload = this.ndkPayload;
        if (filesPayload == null) {
            if (that.getNdkPayload() == null) {
                return true;
            }
        } else if (filesPayload.equals(that.getNdkPayload())) {
            return true;
        }
    }
    return false;
}
Also used : CrashlyticsReport(com.google.firebase.crashlytics.internal.model.CrashlyticsReport)

Aggregations

CrashlyticsReport (com.google.firebase.crashlytics.internal.model.CrashlyticsReport)34 CrashlyticsReportWithSessionId (com.google.firebase.crashlytics.internal.common.CrashlyticsReportWithSessionId)13 Session (com.google.firebase.crashlytics.internal.model.CrashlyticsReport.Session)13 Event (com.google.firebase.crashlytics.internal.model.CrashlyticsReport.Session.Event)13 IOException (java.io.IOException)8 File (java.io.File)6 Test (org.junit.Test)5 Logger (com.google.firebase.crashlytics.internal.Logger)4 NonNull (androidx.annotation.NonNull)2 TaskCompletionSource (com.google.android.gms.tasks.TaskCompletionSource)2 ArrayList (java.util.ArrayList)2 JsonReader (android.util.JsonReader)1 Settings (com.google.firebase.crashlytics.internal.settings.Settings)1 FeatureFlagData (com.google.firebase.crashlytics.internal.settings.Settings.FeatureFlagData)1 SettingsProvider (com.google.firebase.crashlytics.internal.settings.SettingsProvider)1 StringReader (java.io.StringReader)1