Package com.microsoft.appcenter.crashes
Class AbstractCrashesListener
- java.lang.Object
-
- com.microsoft.appcenter.crashes.AbstractCrashesListener
-
- All Implemented Interfaces:
CrashesListener
public abstract class AbstractCrashesListener extends java.lang.Object implements CrashesListener
Abstract class with default behaviors for the crashes listener.
-
-
Constructor Summary
Constructors Constructor Description AbstractCrashesListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<ErrorAttachmentLog>getErrorAttachments(ErrorReport report)Called from a worker thread to get additional information to be sent as separate ErrorAttachmentLog logs Attachments are optional so this method can also returnnull.voidonBeforeSending(ErrorReport report)Called from UI thread right before sending a crash report.voidonSendingFailed(ErrorReport report, java.lang.Exception e)Called from UI thread when sending a crash report failed.voidonSendingSucceeded(ErrorReport report)Called from UI thread when a crash report is sent successfully.booleanshouldAwaitUserConfirmation()Called from UI thread to determine whether it should wait for user confirmation before sending crash reports.booleanshouldProcess(ErrorReport report)Called from a worker thread to determine whether a crash report should be processed or not.
-
-
-
Method Detail
-
shouldProcess
public boolean shouldProcess(ErrorReport report)
Description copied from interface:CrashesListenerCalled from a worker thread to determine whether a crash report should be processed or not.- Specified by:
shouldProcessin interfaceCrashesListener- Parameters:
report- A crash report that will be sent.- Returns:
trueif it should be processed and sent, otherwisefalse.
-
shouldAwaitUserConfirmation
public boolean shouldAwaitUserConfirmation()
Description copied from interface:CrashesListenerCalled from UI thread to determine whether it should wait for user confirmation before sending crash reports.- Specified by:
shouldAwaitUserConfirmationin interfaceCrashesListener- Returns:
trueif it requires to be confirmed by a user, otherwisefalse. If this method returnstrue,Crashes.notifyUserConfirmation(int)must be called by yourself.
-
getErrorAttachments
public java.lang.Iterable<ErrorAttachmentLog> getErrorAttachments(ErrorReport report)
Description copied from interface:CrashesListenerCalled from a worker thread to get additional information to be sent as separate ErrorAttachmentLog logs Attachments are optional so this method can also returnnull.- Specified by:
getErrorAttachmentsin interfaceCrashesListener- Parameters:
report- The crash report for additional information.- Returns:
- instances of
ErrorAttachmentLogto be sent for the specified error report.
-
onBeforeSending
public void onBeforeSending(ErrorReport report)
Description copied from interface:CrashesListenerCalled from UI thread right before sending a crash report. The callback can be invoked multiple times based on the number of crash reports.- Specified by:
onBeforeSendingin interfaceCrashesListener- Parameters:
report- The crash report that will be sent.
-
onSendingFailed
public void onSendingFailed(ErrorReport report, java.lang.Exception e)
Description copied from interface:CrashesListenerCalled from UI thread when sending a crash report failed. The report failed to send after the maximum retries so it will be discarded and won't be retried.- Specified by:
onSendingFailedin interfaceCrashesListener- Parameters:
report- The crash report that failed to send.e- An exception that caused failure.
-
onSendingSucceeded
public void onSendingSucceeded(ErrorReport report)
Description copied from interface:CrashesListenerCalled from UI thread when a crash report is sent successfully.- Specified by:
onSendingSucceededin interfaceCrashesListener- Parameters:
report- The crash report that was sent successfully.
-
-