Simplify error text

pull/146/head
M66B 6 years ago
parent a0a1bae830
commit 5850fa36ad

@ -602,6 +602,10 @@ public class ServiceSynchronize extends LifecycleService {
PendingIntent pi = PendingIntent.getActivity( PendingIntent pi = PendingIntent.getActivity(
this, ActivitySetup.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT); this, ActivitySetup.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT);
String text = ex.getMessage();
if (TextUtils.isEmpty(text))
text = ex.getClass().getName();
// Build notification // Build notification
Notification.Builder builder; Notification.Builder builder;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
@ -612,7 +616,7 @@ public class ServiceSynchronize extends LifecycleService {
builder builder
.setSmallIcon(android.R.drawable.stat_notify_error) .setSmallIcon(android.R.drawable.stat_notify_error)
.setContentTitle(getString(R.string.title_notification_failed, action)) .setContentTitle(getString(R.string.title_notification_failed, action))
.setContentText(Helper.formatThrowable(ex)) .setContentText(text)
.setContentIntent(pi) .setContentIntent(pi)
.setAutoCancel(false) .setAutoCancel(false)
.setShowWhen(true) .setShowWhen(true)

Loading…
Cancel
Save