author | Martyn Haigh <martyn.haigh@gmail.com> |
Tue, 05 May 2015 17:04:00 +0100 | |
changeset 242392 | 3b908ec52d4e3d8a15ac384e6d0571939e12d5fa |
parent 242391 | ba9bb4a353b49c94071ce7bb7a9eedaf926cbf25 |
child 242393 | 604006b0845484f556149275e35aa489f2a3dbe5 |
push id | 28693 |
push user | kwierso@gmail.com |
push date | Wed, 06 May 2015 03:23:28 +0000 |
treeherder | mozilla-central@f938222ff4ce [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mcomella |
bugs | 1159718 |
milestone | 40.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
mobile/android/base/tabqueue/TabQueueHelper.java | file | annotate | diff | comparison | revisions | |
mobile/android/base/tabqueue/TabQueueService.java | file | annotate | diff | comparison | revisions |
--- a/mobile/android/base/tabqueue/TabQueueHelper.java +++ b/mobile/android/base/tabqueue/TabQueueHelper.java @@ -196,19 +196,17 @@ public class TabQueueHelper { // TODO: Use profile shared prefs when bug 1147925 gets fixed. final SharedPreferences prefs = GeckoSharedPrefs.forApp(context); return prefs.getInt(PREF_TAB_QUEUE_COUNT, 0); } 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) { return; } JSONArray jsonArray = profile.readJSONArrayFromFile(filename); @@ -230,16 +228,21 @@ public class TabQueueHelper { Log.e(LOGTAG, "Error deleting Tab Queue data file.", e); } // TODO: Use profile shared prefs when bug 1147925 gets fixed. final SharedPreferences prefs = GeckoSharedPrefs.forApp(context); 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(); switch (resultCode) { case TAB_QUEUE_YES: editor.putBoolean(GeckoPreferences.PREFS_TAB_QUEUE, true);
--- a/mobile/android/base/tabqueue/TabQueueService.java +++ b/mobile/android/base/tabqueue/TabQueueService.java @@ -189,16 +189,18 @@ public class TabQueueService extends Ser } private void openNow(Intent intent) { Intent forwardIntent = new Intent(intent); forwardIntent.setClassName(getApplicationContext(), AppConstants.BROWSER_INTENT_CLASS_NAME); 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(); } private void removeView() { windowManager.removeView(toastLayout); }