use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.
the class DataTransportCrashlyticsReportSender method sendReport.
public Task<CrashlyticsReportWithSessionId> sendReport(CrashlyticsReportWithSessionId reportWithSessionId) {
CrashlyticsReport report = reportWithSessionId.getReport();
TaskCompletionSource<CrashlyticsReportWithSessionId> tcs = new TaskCompletionSource<>();
this.transport.schedule(Event.ofUrgent(report), DataTransportCrashlyticsReportSender$$Lambda$1.lambdaFactory$(tcs, reportWithSessionId));
return tcs.getTask();
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.
the class CrashlyticsReportJsonTransform method reportFromJson.
public CrashlyticsReport reportFromJson(String json) throws IOException {
try {
JsonReader jsonReader = new JsonReader(new StringReader(json));
CrashlyticsReport parseReport = parseReport(jsonReader);
jsonReader.close();
return parseReport;
} catch (IllegalStateException e) {
throw new IOException(e);
}
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.
the class CrashlyticsReportPersistence method synthesizeReportFile.
private static void synthesizeReportFile(File reportFile, File outputDirectory, List<CrashlyticsReport.Session.Event> events, long sessionEndTime, boolean isCrashed, String userId) {
try {
CrashlyticsReport report = TRANSFORM.reportFromJson(readTextFile(reportFile)).withSessionEndFields(sessionEndTime, isCrashed, userId).withEvents(ImmutableList.from(events));
CrashlyticsReport.Session session = report.getSession();
if (session != null) {
writeTextFile(new File(prepareDirectory(outputDirectory), session.getIdentifier()), TRANSFORM.reportToJson(report));
}
} catch (IOException e) {
Logger logger = Logger.getLogger();
logger.d("Could not synthesize final report file for " + reportFile, e);
}
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.
the class CrashlyticsReportPersistence method persistReport.
public void persistReport(CrashlyticsReport report) {
CrashlyticsReport.Session session = report.getSession();
if (session == null) {
Logger.getLogger().d("Could not get session for report");
return;
}
String sessionId = session.getIdentifier();
try {
File sessionDirectory = prepareDirectory(getSessionDirectoryById(sessionId));
String json = TRANSFORM.reportToJson(report);
writeTextFile(new File(sessionDirectory, REPORT_FILE_NAME), json);
} catch (IOException e) {
Logger logger = Logger.getLogger();
logger.d("Could not persist report for session " + sessionId, e);
}
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project GreenHouse by utsanjan.
the class CrashlyticsReportPersistence method synthesizeNativeReportFile.
private static void synthesizeNativeReportFile(File reportFile, File outputDirectory, CrashlyticsReport.FilesPayload ndkPayload, String previousSessionId) {
try {
CrashlyticsReport report = TRANSFORM.reportFromJson(readTextFile(reportFile)).withNdkPayload(ndkPayload);
writeTextFile(new File(prepareDirectory(outputDirectory), previousSessionId), TRANSFORM.reportToJson(report));
} catch (IOException e) {
Logger logger = Logger.getLogger();
logger.d("Could not synthesize final native report file for " + reportFile, e);
}
}
Aggregations