Bug 1279332 - Backed out 97074800423c since it depends on a commit breaking background runnables r=sebastian
MozReview-Commit-ID: 6jYh8ipOw3q
--- 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();
}