diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 292fbf67c8..f9b0937eee 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -101,8 +101,6 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On static final int REQUEST_EXPORT = 4; static final int REQUEST_IMPORT = 5; - static final int REQUEST_ERROR = 6; - static final String ACTION_EDIT_ACCOUNT = BuildConfig.APPLICATION_ID + ".EDIT_ACCOUNT"; static final String ACTION_EDIT_IDENTITY = BuildConfig.APPLICATION_ID + ".EDIT_IDENTITY"; diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 3fce3ef51f..ef87c491bf 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -111,6 +111,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB static final int REQUEST_UNIFIED = 1; static final int REQUEST_WHY = 2; static final int REQUEST_THREAD = 3; + static final int REQUEST_OUTBOX = 4; + static final int REQUEST_ERROR = 5; static final int REQUEST_RAW = 1; static final int REQUEST_ATTACHMENT = 2; @@ -453,7 +455,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB startActivity(iwhy); } - } else if ("error".equals(action)) + } else if ("outbox".equals(action)) + onMenuOutbox(); + + else if ("error".equals(action)) onDebugInfo(); else if (action.startsWith("thread")) { diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index dc52f7054d..d650d82b4c 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -1830,12 +1830,12 @@ class Core { static NotificationCompat.Builder getNotificationError(Context context, String channel, String title, Throwable ex, boolean debug) { // Build pending intent - Intent intent = new Intent(context, ActivitySetup.class); + Intent intent = new Intent(context, ActivityView.class); if (debug) intent.setAction("error"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity( - context, ActivitySetup.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT); + context, ActivityView.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT); // Build notification NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channel); diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index 6203e95fc1..d7ff009428 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -20,6 +20,7 @@ package eu.faircode.email; */ import android.app.NotificationManager; +import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; @@ -112,13 +113,21 @@ public class ServiceSend extends LifecycleService { if (unsent != null) lastUnsent = unsent; + // Build pending intent + Intent intent = new Intent(this, ActivityView.class); + intent.setAction("outbox"); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + PendingIntent pi = PendingIntent.getActivity( + this, ActivityView.REQUEST_OUTBOX, intent, PendingIntent.FLAG_UPDATE_CURRENT); + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "service"); builder .setSmallIcon(R.drawable.baseline_send_24) .setContentTitle(getString(R.string.title_notification_sending)) + .setContentIntent(pi) .setAutoCancel(false) - .setShowWhen(false) + .setShowWhen(true) .setPriority(NotificationCompat.PRIORITY_MIN) .setCategory(NotificationCompat.CATEGORY_STATUS) .setVisibility(NotificationCompat.VISIBILITY_SECRET);