public class Crashes
extends com.microsoft.appcenter.AbstractAppCenterService
| Modifier and Type | Field and Description |
|---|---|
static int |
ALWAYS_SEND
Constant for ALWAYS SEND crash reports.
|
static int |
DONT_SEND
Constant for DO NOT SEND crash report.
|
static java.lang.String |
LOG_TAG
TAG used in logging for Crashes.
|
static java.lang.String |
PREF_KEY_ALWAYS_SEND
Preference storage key for ALWAYS SEND.
|
static int |
SEND
Constant for SEND crash report.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyEnabledState(boolean enabled) |
static void |
generateTestCrash()
Generates crash for test purpose.
|
protected com.microsoft.appcenter.channel.Channel.GroupListener |
getChannelListener() |
protected java.lang.String |
getGroupName() |
static Crashes |
getInstance() |
static com.microsoft.appcenter.utils.async.AppCenterFuture<ErrorReport> |
getLastSessionCrashReport()
Provides information about any available crash report from the last session, if it crashed.
|
java.util.Map<java.lang.String,com.microsoft.appcenter.ingestion.models.json.LogFactory> |
getLogFactories() |
protected java.lang.String |
getLoggerTag() |
static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.String> |
getMinidumpDirectory()
Get the path where NDK minidump files should be created.
|
java.lang.String |
getServiceName() |
protected int |
getTriggerCount() |
static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> |
hasCrashedInLastSession()
Check whether the app crashed in its last session.
|
static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> |
isEnabled()
Check whether Crashes service is enabled or not.
|
static void |
notifyUserConfirmation(int userConfirmation)
Notifies SDK with a confirmation to handle the crash report.
|
void |
onStarted(android.content.Context context,
com.microsoft.appcenter.channel.Channel channel,
java.lang.String appSecret,
java.lang.String transmissionTargetToken,
boolean startedFromApp) |
static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Void> |
setEnabled(boolean enabled)
Enable or disable Crashes service.
|
static void |
setListener(CrashesListener listener)
Sets a crashes listener.
|
getEnabledPreferenceKey, getTriggerInterval, getTriggerMaxParallelRequests, isAppSecretRequired, isInstanceEnabled, isInstanceEnabledAsync, onActivityCreated, onActivityDestroyed, onActivityPaused, onActivityResumed, onActivitySaveInstanceState, onActivityStarted, onActivityStopped, onConfigurationUpdated, onStarting, post, post, postAsyncGetter, postOnUiThread, setInstanceEnabled, setInstanceEnabledAsyncpublic static final int SEND
public static final int DONT_SEND
public static final int ALWAYS_SEND
public static final java.lang.String PREF_KEY_ALWAYS_SEND
public static final java.lang.String LOG_TAG
@NonNull public static Crashes getInstance()
public static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> isEnabled()
true if enabled, false otherwise.AppCenterFuturepublic static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Void> setEnabled(boolean enabled)
enabled - true to enable, false to disable.public static void generateTestCrash()
public static void setListener(CrashesListener listener)
listener - The custom crashes listener.public static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.String> getMinidumpDirectory()
public static void notifyUserConfirmation(int userConfirmation)
userConfirmation - A user confirmation. Should be one of SEND, DONT_SEND or ALWAYS_SENDSEND,
DONT_SEND,
ALWAYS_SENDpublic static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> hasCrashedInLastSession()
true if there was a crash in the last session, false otherwise.AppCenterFuturepublic static com.microsoft.appcenter.utils.async.AppCenterFuture<ErrorReport> getLastSessionCrashReport()
AppCenterFutureprotected void applyEnabledState(boolean enabled)
applyEnabledState in class com.microsoft.appcenter.AbstractAppCenterServicepublic void onStarted(@NonNull
android.content.Context context,
@NonNull
com.microsoft.appcenter.channel.Channel channel,
java.lang.String appSecret,
java.lang.String transmissionTargetToken,
boolean startedFromApp)
onStarted in interface com.microsoft.appcenter.AppCenterServiceonStarted in class com.microsoft.appcenter.AbstractAppCenterServicepublic java.util.Map<java.lang.String,com.microsoft.appcenter.ingestion.models.json.LogFactory> getLogFactories()
getLogFactories in interface com.microsoft.appcenter.AppCenterServicegetLogFactories in class com.microsoft.appcenter.AbstractAppCenterServiceprotected java.lang.String getGroupName()
getGroupName in class com.microsoft.appcenter.AbstractAppCenterServicepublic java.lang.String getServiceName()
protected java.lang.String getLoggerTag()
getLoggerTag in class com.microsoft.appcenter.AbstractAppCenterServiceprotected int getTriggerCount()
getTriggerCount in class com.microsoft.appcenter.AbstractAppCenterServiceprotected com.microsoft.appcenter.channel.Channel.GroupListener getChannelListener()
getChannelListener in class com.microsoft.appcenter.AbstractAppCenterService