Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r?margaret
MozReview-Commit-ID: qTtRaQuZyo
--- a/mobile/android/base/java/org/mozilla/gecko/tabqueue/TabQueueService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabqueue/TabQueueService.java
@@ -172,17 +172,17 @@ public class TabQueueService extends Ser
if (stopServiceRunnable != null) {
// If we're already displaying a toast, keep displaying it but store the previous url.
// The open button will refer to the most recently opened link.
tabQueueHandler.removeCallbacks(stopServiceRunnable);
stopServiceRunnable.run(false);
} else {
try {
windowManager.addView(toastLayout, toastLayoutParams);
- } catch (final SecurityException e) {
+ } catch (final SecurityException | WindowManager.BadTokenException e) {
Toast.makeText(this, getText(R.string.tab_queue_toast_message), Toast.LENGTH_SHORT).show();
showSettingsNotification();
}
}
stopServiceRunnable = new StopServiceRunnable(startId) {
@Override
public void onRun() {