diff --git a/mobile/android/base/tabqueue/TabQueueHelper.java b/mobile/android/base/tabqueue/TabQueueHelper.java index 767078300b4c..edd823dc684d 100644 --- a/mobile/android/base/tabqueue/TabQueueHelper.java +++ b/mobile/android/base/tabqueue/TabQueueHelper.java @@ -201,9 +201,7 @@ public class TabQueueHelper { public static void openQueuedUrls(final Context context, final GeckoProfile profile, final String filename, boolean shouldPerformJavaScriptCallback) { ThreadUtils.assertNotOnUiThread(); - // Remove the notification. - NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(TAB_QUEUE_NOTIFICATION_ID); + removeNotification(context); // exit early if we don't have any tabs queued if (getTabQueueLength(context) < 1) { @@ -235,6 +233,11 @@ public class TabQueueHelper { prefs.edit().remove(PREF_TAB_QUEUE_COUNT).apply(); } + protected static void removeNotification(Context context) { + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + notificationManager.cancel(TAB_QUEUE_NOTIFICATION_ID); + } + public static void processTabQueuePromptResponse(int resultCode, Context context) { final SharedPreferences prefs = GeckoSharedPrefs.forApp(context); final SharedPreferences.Editor editor = prefs.edit(); diff --git a/mobile/android/base/tabqueue/TabQueueService.java b/mobile/android/base/tabqueue/TabQueueService.java index e5809352ea09..007b8e2be16c 100644 --- a/mobile/android/base/tabqueue/TabQueueService.java +++ b/mobile/android/base/tabqueue/TabQueueService.java @@ -194,6 +194,8 @@ public class TabQueueService extends Service { forwardIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(forwardIntent); + TabQueueHelper.removeNotification(getApplicationContext()); + GeckoSharedPrefs.forApp(getApplicationContext()).edit().remove(GeckoPreferences.PREFS_TAB_QUEUE_LAST_SITE) .remove(GeckoPreferences.PREFS_TAB_QUEUE_LAST_TIME) .apply();