Bug 1279332 - Backed out 97074800423c since it depends on a commit breaking background runnables r=sebastian
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 10 Jun 2016 04:30:26 -0700
changeset 377457 4fb66e8edacad1ab21a6b52d6ef8c0f078728090
parent 377456 c97ec840ee011a41f076e3d6c8543770445628d5
child 377464 151500c01e44846223acb5bfcb4dcd2123e620c5
push id20797
push userahunt@mozilla.com
push dateFri, 10 Jun 2016 11:31:55 +0000
reviewerssebastian
bugs1279332
milestone50.0a1
Bug 1279332 - Backed out 97074800423c since it depends on a commit breaking background runnables r=sebastian MozReview-Commit-ID: 6jYh8ipOw3q
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/widget/GeckoActionProvider.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -3320,24 +3320,17 @@ public class BrowserApp extends GeckoApp
             final GeckoActionProvider provider = ((GeckoMenuItem) share).getGeckoActionProvider();
             if (provider != null) {
                 Intent shareIntent = provider.getIntent();
 
                 // For efficiency, the provider's intent is only set once
                 if (shareIntent == null) {
                     shareIntent = new Intent(Intent.ACTION_SEND);
                     shareIntent.setType("text/plain");
-
-                    final Intent intentToSet = shareIntent;
-                    ThreadUtils.postToBackgroundThread(new Runnable() {
-                        @Override
-                        public void run() {
-                            provider.setIntent(intentToSet);
-                        }
-                    });
+                    provider.setIntent(shareIntent);
                 }
 
                 // Replace the existing intent's extras
                 shareIntent.putExtra(Intent.EXTRA_TEXT, url);
                 shareIntent.putExtra(Intent.EXTRA_SUBJECT, tab.getDisplayTitle());
                 shareIntent.putExtra(Intent.EXTRA_TITLE, tab.getDisplayTitle());
                 shareIntent.putExtra(ShareDialog.INTENT_EXTRA_DEVICES_ONLY, true);
 
--- a/mobile/android/base/java/org/mozilla/gecko/widget/GeckoActionProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/GeckoActionProvider.java
@@ -190,22 +190,16 @@ public class GeckoActionProvider {
         mHistoryFileName = historyFile;
     }
 
     public Intent getIntent() {
         ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
         return dataModel.getIntent();
     }
 
-    /**
-     * Must be run on a background thread due to DB access.
-     *
-     * DB access happens in ActivityChosseModel when it retrieves the list of sync clients
-     * if sync is enabled.
-     */
     public void setIntent(Intent intent) {
         ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
         dataModel.setIntent(intent);
 
         // Inform the target listener to refresh it's UI, if needed.
         if (mOnTargetListener != null) {
             mOnTargetListener.onTargetSelected();
         }