зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1159718 - Remove notification when 'quick open' is activated in Tab Queue (r=mcomella)
This commit is contained in:
Родитель
0367f94a69
Коммит
0412129907
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче