Bug 1012462 - Part 7: Enable distribution support in SuggestedSites (r=rnewman)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 15 Jul 2014 20:54:28 +0100
changeset 216240 b9398f6def8be04dccab147645572268bbca052a
parent 216239 13b4b1b388e270cba618a1432410be4ab484e838
child 216241 ae2fd2045cf3fcea7c7183b663e8e42d40fbd64e
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1012462
milestone33.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 1012462 - Part 7: Enable distribution support in SuggestedSites (r=rnewman)
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -471,20 +471,16 @@ public class BrowserApp extends GeckoApp
         // This has to be prepared prior to calling GeckoApp.onCreate, because
         // widget code and BrowserToolbar need it, and they're created by the
         // layout, which GeckoApp takes care of.
         ((GeckoApplication) getApplication()).prepareLightweightTheme();
         super.onCreate(savedInstanceState);
 
         final Context appContext = getApplicationContext();
 
-        // Init suggested sites engine in BrowserDB.
-        final SuggestedSites suggestedSites = new SuggestedSites(appContext);
-        BrowserDB.setSuggestedSites(suggestedSites);
-
         mViewFlipper = (ViewFlipper) findViewById(R.id.browser_actionbar);
         mActionBar = (ActionModeCompatView) findViewById(R.id.actionbar);
 
         mBrowserToolbar = (BrowserToolbar) findViewById(R.id.browser_toolbar);
         mProgressView = (ToolbarProgressView) findViewById(R.id.progress);
         mBrowserToolbar.setProgressBar(mProgressView);
         if (Intent.ACTION_VIEW.equals(intent.getAction())) {
             // Show the target URL immediately in the toolbar.
@@ -547,17 +543,21 @@ public class BrowserApp extends GeckoApp
             "Menu:Remove",
             "Reader:ListStatusRequest",
             "Reader:Removed",
             "Reader:Share",
             "Settings:Show",
             "Telemetry:Gather",
             "Updater:Launch");
 
-        Distribution.init(this);
+        Distribution distribution = Distribution.init(this);
+
+        // Init suggested sites engine in BrowserDB.
+        final SuggestedSites suggestedSites = new SuggestedSites(appContext, distribution);
+        BrowserDB.setSuggestedSites(suggestedSites);
 
         // Shipping Native casting is optional and dependent on whether you've downloaded the support
         // and google play libraries
         if (AppConstants.MOZ_MEDIA_PLAYER) {
             try {
                 Class<?> mediaManagerClass = Class.forName("org.mozilla.gecko.MediaPlayerManager");
                 Method init = mediaManagerClass.getMethod("init", Context.class);
                 init.invoke(null, this);