mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-24 00:24:14 +00:00
Bug 968308 - Part 2: Session for about:home. r=liuche
This commit is contained in:
parent
b30de2f6b2
commit
ae23decf61
39
mobile/android/base/TelemetryContract.java
Normal file
39
mobile/android/base/TelemetryContract.java
Normal file
@ -0,0 +1,39 @@
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; 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;
|
||||
|
||||
/**
|
||||
* Holds data definitions for our UI Telemetry implementation.
|
||||
*/
|
||||
public interface TelemetryContract {
|
||||
|
||||
/**
|
||||
* Holds event names. Intended for use with
|
||||
* Telemetry.sendUIEvent() as the "action" parameter.
|
||||
*/
|
||||
public interface Event {}
|
||||
|
||||
/**
|
||||
* Holds event methods. Intended for use in
|
||||
* Telemetry.sendUIEvent() as the "method" parameter.
|
||||
*/
|
||||
public interface Method {}
|
||||
|
||||
/**
|
||||
* Holds session names. Intended for use with
|
||||
* Telemetry.startUISession() as the "sessionName" parameter.
|
||||
*/
|
||||
public interface Session {
|
||||
// Started when a user enters about:home.
|
||||
public static final String HOME = "home.1";
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds reasons for stopping a session. Intended for use in
|
||||
* Telemetry.stopUISession() as the "reason" parameter.
|
||||
*/
|
||||
public interface Reason {}
|
||||
}
|
@ -10,6 +10,8 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.Telemetry;
|
||||
import org.mozilla.gecko.TelemetryContract;
|
||||
import org.mozilla.gecko.animation.PropertyAnimator;
|
||||
import org.mozilla.gecko.animation.ViewHelper;
|
||||
import org.mozilla.gecko.home.HomeAdapter.OnAddPanelListener;
|
||||
@ -195,6 +197,7 @@ public class HomePager extends ViewPager {
|
||||
PropertyAnimator.Property.ALPHA,
|
||||
1.0f);
|
||||
}
|
||||
Telemetry.startUISession(TelemetryContract.Session.HOME);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,6 +206,7 @@ public class HomePager extends ViewPager {
|
||||
public void unload() {
|
||||
mLoaded = false;
|
||||
setAdapter(null);
|
||||
Telemetry.stopUISession(TelemetryContract.Session.HOME);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -347,6 +347,7 @@ gbjar.sources += [
|
||||
'TabsPanel.java',
|
||||
'TabsTray.java',
|
||||
'Telemetry.java',
|
||||
'TelemetryContract.java',
|
||||
'TextSelection.java',
|
||||
'TextSelectionHandle.java',
|
||||
'ThumbnailHelper.java',
|
||||
|
Loading…
Reference in New Issue
Block a user