Bug 1058813 - Add telemetry probe for clicking sync preference. r=liuche, a=sledru
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 05 Sep 2014 15:39:49 -0700
changeset 217901 340bddec5bf5a8fdd134e7e52ee5de50e4f05410
parent 217900 e981cc82a3e5bd57f1fd97395d5b196642bf4044
child 217902 6c39ccb686a5fa5b3dfd816eebbc4b585ce1efc1
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)
reviewersliuche, sledru
bugs1058813
milestone33.0
Bug 1058813 - Add telemetry probe for clicking sync preference. r=liuche, a=sledru
mobile/android/base/preferences/SyncPreference.java
--- a/mobile/android/base/preferences/SyncPreference.java
+++ b/mobile/android/base/preferences/SyncPreference.java
@@ -1,15 +1,18 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.preferences;
 
+import org.mozilla.gecko.Telemetry;
+import org.mozilla.gecko.TelemetryContract;
+import org.mozilla.gecko.TelemetryContract.Method;
 import org.mozilla.gecko.fxa.activities.FxAccountGetStartedActivity;
 import org.mozilla.gecko.sync.setup.SyncAccounts;
 import org.mozilla.gecko.sync.setup.activities.SetupSyncActivity;
 import org.mozilla.gecko.util.HardwareUtils;
 
 import android.content.Context;
 import android.content.Intent;
 import android.preference.Preference;
@@ -55,17 +58,19 @@ class SyncPreference extends Preference 
             openSync11Settings();
             return;
         }
 
         // If there's a legacy Sync account (or a pickled one on disk),
         // open the settings page.
         if (SyncAccounts.syncAccountsExist(mContext)) {
             if (SyncAccounts.openSyncSettings(mContext) != null) {
+                Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, Method.SETTINGS, "sync_settings");
                 return;
             }
         }
 
         // Otherwise, launch the FxA "Get started" activity, which will
         // dispatch to the right location.
         launchFxASetup();
+        Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, Method.SETTINGS, "sync_setup");
     }
 }