Bug 1099436 - Add telemetry for dismissing Onboarding start pane. r=mfinkle, a=lsblakk
authorChenxia Liu <liuche@mozilla.com>
Mon, 17 Nov 2014 11:14:11 -0800
changeset 226068 3ef1a2619a9213390a8112da81096bb07ab5c20e
parent 226067 83431c9e9460aaaf41b1960e04fe418a555a86e8
child 226069 c77506b180c8d6dc93ad9349ad43823e61bd6bfa
push id4135
push usercliu@mozilla.com
push dateMon, 17 Nov 2014 19:14:32 +0000
treeherdermozilla-beta@3ef1a2619a92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lsblakk
bugs1099436
milestone34.0
Bug 1099436 - Add telemetry for dismissing Onboarding start pane. r=mfinkle, a=lsblakk
mobile/android/base/StartPane.java
--- a/mobile/android/base/StartPane.java
+++ b/mobile/android/base/StartPane.java
@@ -1,12 +1,13 @@
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.fxa.activities.FxAccountGetStartedActivity;
 
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v4.app.DialogFragment;
 import android.view.GestureDetector;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -50,21 +51,29 @@ public class StartPane extends DialogFra
                 StartPane.this.dismiss();
             }
         });
 
         addDismissHandler(view);
         return view;
     }
 
+    @Override
+    public void onCancel(DialogInterface dialog) {
+        // StartPane is closed by touching outside the dialog.
+        Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL, TelemetryContract.Method.DIALOG, "firstrun-pane");
+        super.onCancel(dialog);
+    }
+
     // Add handler for dismissing the StartPane on a single click.
     private void addDismissHandler(View view) {
         final GestureDetector gestureDetector = new GestureDetector(getActivity(), new GestureDetector.SimpleOnGestureListener() {
             @Override
             public boolean onSingleTapUp(MotionEvent e) {
+                Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL, TelemetryContract.Method.DIALOG, "firstrun-pane");
                 StartPane.this.dismiss();
                 return true;
             }
         });
 
         view.findViewById(R.id.onboard_content).setOnTouchListener(new OnTouchListener() {
             @Override
             public boolean onTouch(View v, MotionEvent event) {