diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 3f4c42aad6..0f45785179 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -93,7 +93,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac static final int REQUEST_DELETE_ACCOUNT = 11; static final int REQUEST_IMPORT_PROVIDERS = 12; - static final int PI_MISC = 1; + static final int PI_CONNECTION = 1; + static final int PI_MISC = 2; static final String ACTION_QUICK_GMAIL = BuildConfig.APPLICATION_ID + ".ACTION_QUICK_GMAIL"; static final String ACTION_QUICK_OAUTH = BuildConfig.APPLICATION_ID + ".ACTION_QUICK_OAUTH"; diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index 7d05f69fcf..502f1c8a9b 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -245,6 +245,20 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar if (lastProgress >= 0) builder.setProgress(100, lastProgress, false); + if (!lastSuitable) { + Intent manage = new Intent(this, ActivitySetup.class) + .setAction("connection") + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK) + .putExtra("tab", "connection"); + PendingIntent piManage = PendingIntentCompat.getActivity( + this, ActivitySetup.PI_CONNECTION, manage, PendingIntent.FLAG_UPDATE_CURRENT); + NotificationCompat.Action.Builder actionManage = new NotificationCompat.Action.Builder( + R.drawable.twotone_settings_24, + getString(R.string.title_setup_manage), + piManage); + builder.addAction(actionManage.build()); + } + Notification notification = builder.build(); notification.flags |= Notification.FLAG_NO_CLEAR; return notification;