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 238893 2057c753a9aaeb384d7c8a36ace43b031c856dd6
parent 238892 3c249cba737c07e2d400e0c12786623bc1e6aedc
child 238894 a3f65d0021f79dcb8ea32d75025b315ad0bda967
push id12361
push usermhaigh@mozilla.com
push dateTue, 14 Apr 2015 13:18:18 +0000
treeherderfx-team@2057c753a9aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1153908
milestone40.0a1
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";