mirror of
https://github.com/etesync/android
synced 2024-12-23 23:18:46 +00:00
ACRA: switch to notification alerts on crashes.
On some devices users weren't able to send stack traces because EteSync would restart and then hide/cancel the email app chooser.
This commit is contained in:
parent
332caf1631
commit
cf8afd541c
@ -131,7 +131,7 @@ dependencies {
|
||||
|
||||
def acraVersion = '5.2.1'
|
||||
implementation "ch.acra:acra-mail:$acraVersion"
|
||||
implementation "ch.acra:acra-toast:$acraVersion"
|
||||
implementation "ch.acra:acra-notification:$acraVersion"
|
||||
def supportVersion = '1.0.0'
|
||||
implementation "androidx.legacy:legacy-support-core-ui:$supportVersion"
|
||||
implementation "androidx.core:core:$supportVersion"
|
||||
|
@ -1,11 +1,10 @@
|
||||
package com.etesync.syncadapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.acra.config.CoreConfigurationBuilder;
|
||||
import org.acra.config.MailSenderConfigurationBuilder;
|
||||
import org.acra.config.ToastConfigurationBuilder;
|
||||
import org.acra.config.NotificationConfigurationBuilder;
|
||||
import org.acra.data.StringFormat;
|
||||
|
||||
import static com.etesync.syncadapter.utils.EventEmailInvitationKt.emailSupportsAttachments;
|
||||
@ -22,9 +21,11 @@ public class AcraConfiguration {
|
||||
.setReportFileName("ACRA-report.stacktrace.json")
|
||||
.setReportAsFile(emailSupportsAttachments(context))
|
||||
.setEnabled(true);
|
||||
builder.getPluginConfigurationBuilder(ToastConfigurationBuilder.class)
|
||||
builder.getPluginConfigurationBuilder(NotificationConfigurationBuilder.class)
|
||||
.setResTitle(R.string.crash_title)
|
||||
.setResText(R.string.crash_message)
|
||||
.setLength(Toast.LENGTH_SHORT)
|
||||
.setChannelName("crash-notification")
|
||||
.setSendOnClick(true)
|
||||
.setEnabled(true);
|
||||
|
||||
return builder;
|
||||
|
@ -113,7 +113,7 @@ class App : Application() {
|
||||
// The following line triggers the initialization of ACRA
|
||||
ACRA.init(this, AcraConfiguration.getConfig(this))
|
||||
val pm = base.packageManager
|
||||
var installedFrom = pm.getInstallerPackageName(BuildConfig.APPLICATION_ID)
|
||||
val installedFrom = pm.getInstallerPackageName(BuildConfig.APPLICATION_ID)
|
||||
ACRA.getErrorReporter().putCustomData("installedFrom", installedFrom);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,8 @@
|
||||
<string name="send">Send</string>
|
||||
|
||||
<!-- Crash -->
|
||||
<string name="crash_message">EteSync has crashed, please send stack trace to developers.</string>
|
||||
<string name="crash_title">EteSync has crashed!</string>
|
||||
<string name="crash_message">Please send stack trace to developers.</string>
|
||||
<string name="crash_email_subject">EteSync Debug Info</string>
|
||||
|
||||
<!-- tourguide -->
|
||||
|
Loading…
Reference in New Issue
Block a user