Bug 1153908 - Move Tab Queue Notification click logic off UI thread (r=mcomella)
authorMartyn Haigh <martyn.haigh@gmail.com>
Tue, 14 Apr 2015 14:17:34 +0100
changeset 270452 2057c753a9aaeb384d7c8a36ace43b031c856dd6
parent 270451 3c249cba737c07e2d400e0c12786623bc1e6aedc
child 270453 a3f65d0021f79dcb8ea32d75025b315ad0bda967
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1153908
milestone40.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
Bug 1153908 - Move Tab Queue Notification click logic off UI thread (r=mcomella)
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -3389,23 +3389,33 @@ public class BrowserApp extends GeckoApp
 
         // Only solicit feedback when the app has been launched from the icon shortcut.
         if (GuestSession.NOTIFICATION_INTENT.equals(action)) {
             GuestSession.handleIntent(this, intent);
         }
 
         // If the user has clicked the tab queue notification then load the tabs.
         if(AppConstants.NIGHTLY_BUILD  && AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized && isTabQueueAction) {
-            int queuedTabCount = TabQueueHelper.getTabQueueLength(this);
-            TabQueueHelper.openQueuedUrls(this, mProfile, TabQueueHelper.FILE_NAME, false);
-
-            // If there's more than one tab then also show the tabs panel.
-            if (queuedTabCount > 1) {
-                showNormalTabs();
-            }
+            ThreadUtils.postToBackgroundThread(new Runnable() {
+                @Override
+                public void run() {
+                    int queuedTabCount = TabQueueHelper.getTabQueueLength(BrowserApp.this);
+                    TabQueueHelper.openQueuedUrls(BrowserApp.this, mProfile, TabQueueHelper.FILE_NAME, false);
+
+                    // If there's more than one tab then also show the tabs panel.
+                    if (queuedTabCount > 1) {
+                        ThreadUtils.postToUiThread(new Runnable() {
+                            @Override
+                            public void run() {
+                                showNormalTabs();
+                            }
+                        });
+                    }
+                }
+            });
         }
 
         if (!mInitialized || !Intent.ACTION_MAIN.equals(action)) {
             return;
         }
 
         // Check to see how many times the app has been launched.
         final String keyName = getPackageName() + ".feedback_launch_count";