Bug 1320730 - Ensure homepanel telemetry session is set when panel initially loaded r=sebastian
authorAndrzej Hunt <ahunt@mozilla.com>
Tue, 07 Feb 2017 13:05:34 -0800
changeset 388353 834561bae53c879ee859de1534fbf43cf0910cb3
parent 388319 e0ec9e19af0e0275417628c7d8e850a7a6dfa96f
child 388354 0693364c42ccd5560a2d4f438b540a2829999a2d
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1320730
milestone54.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 1320730 - Ensure homepanel telemetry session is set when panel initially loaded r=sebastian We currently only start a session when swiping between homepanels. We should also send it when showing the homepanel normally. MozReview-Commit-ID: 8Kk2RDCbDDc
mobile/android/base/java/org/mozilla/gecko/home/HomePager.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java
@@ -456,16 +456,22 @@ public class HomePager extends ViewPager
         // UI thread to give the pager time to commit the new page selection
         // internally and load the right initial panel.
         ThreadUtils.getUiHandler().post(new Runnable() {
             @Override
             public void run() {
                 adapter.setCanLoadHint(true);
             }
         });
+
+        // We need to fire telemetry on the initial load: we will subsequently send telemetry whenever
+        // the user switches between homepanels, but the first load doesn't involve any switching hence
+        // we need to send telemetry now:
+        final String panelType = ((HomeAdapter) getAdapter()).getPanelIdAtPosition(mDefaultPageIndex);
+        startNewPanelTelemetrySession(panelType);
     }
 
     @Override
     public void setOnPanelChangeListener(OnPanelChangeListener listener) {
        mPanelChangedListener = listener;
     }
 
     @Override