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 216779 340bddec5bf5
parent 216778 e981cc82a3e5
child 216780 6c39ccb686a5
push id3910
push userryanvm@gmail.com
push date2014-09-18 14:48 +0000
treeherdermozilla-beta@af1dbe183e3d [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");
     }
 }