2014-03-28 22:36:55 +00:00
|
|
|
/* -*- 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;
|
|
|
|
|
2014-05-30 23:53:35 +00:00
|
|
|
import org.mozilla.gecko.mozglue.RobocopTarget;
|
|
|
|
|
2014-03-28 22:36:55 +00:00
|
|
|
/**
|
|
|
|
* Holds data definitions for our UI Telemetry implementation.
|
2014-05-14 03:50:28 +00:00
|
|
|
*
|
2014-05-30 23:53:35 +00:00
|
|
|
* Note that enum values of "_TEST*" are reserved for testing and
|
|
|
|
* should not be changed without changing the associated tests.
|
|
|
|
*
|
2014-05-14 03:50:28 +00:00
|
|
|
* See mobile/android/base/docs/index.rst for a full dictionary.
|
2014-03-28 22:36:55 +00:00
|
|
|
*/
|
2014-05-30 23:53:35 +00:00
|
|
|
@RobocopTarget
|
2014-03-28 22:36:55 +00:00
|
|
|
public interface TelemetryContract {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds event names. Intended for use with
|
|
|
|
* Telemetry.sendUIEvent() as the "action" parameter.
|
2014-05-14 03:50:28 +00:00
|
|
|
*
|
|
|
|
* Please keep this list sorted.
|
2014-03-28 22:36:55 +00:00
|
|
|
*/
|
2014-05-30 23:53:28 +00:00
|
|
|
public enum Event {
|
2014-05-14 03:50:28 +00:00
|
|
|
// Generic action, usually for tracking menu and toolbar actions.
|
2014-05-30 23:53:28 +00:00
|
|
|
ACTION("action.1"),
|
2014-04-02 22:16:47 +00:00
|
|
|
|
2014-05-14 18:29:42 +00:00
|
|
|
// Cancel a state, action, etc.
|
2014-05-30 23:53:28 +00:00
|
|
|
CANCEL("cancel.1"),
|
2014-05-14 18:29:42 +00:00
|
|
|
|
2014-05-15 19:13:39 +00:00
|
|
|
// Editing an item.
|
2014-05-30 23:53:28 +00:00
|
|
|
EDIT("edit.1"),
|
2014-05-15 19:13:39 +00:00
|
|
|
|
2014-05-14 03:50:28 +00:00
|
|
|
// Launching (opening) an external application.
|
|
|
|
// Note: Only used in JavaScript for now, but here for completeness.
|
2014-05-30 23:53:28 +00:00
|
|
|
LAUNCH("launch.1"),
|
2014-04-02 22:16:47 +00:00
|
|
|
|
2014-05-14 03:50:28 +00:00
|
|
|
// Loading a URL.
|
2014-05-30 23:53:28 +00:00
|
|
|
LOAD_URL("loadurl.1"),
|
2014-04-02 22:16:47 +00:00
|
|
|
|
2014-05-30 23:53:28 +00:00
|
|
|
LOCALE_BROWSER_RESET("locale.browser.reset.1"),
|
|
|
|
LOCALE_BROWSER_SELECTED("locale.browser.selected.1"),
|
|
|
|
LOCALE_BROWSER_UNSELECTED("locale.browser.unselected.1"),
|
2014-04-02 23:25:04 +00:00
|
|
|
|
|
|
|
// Set default panel.
|
2014-05-30 23:53:28 +00:00
|
|
|
PANEL_SET_DEFAULT("setdefault.1"),
|
2014-04-29 12:04:10 +00:00
|
|
|
|
2014-05-15 19:13:39 +00:00
|
|
|
// Pinning an item.
|
2014-05-30 23:53:28 +00:00
|
|
|
PIN("pin.1"),
|
2014-05-15 19:13:39 +00:00
|
|
|
|
2014-05-14 03:50:28 +00:00
|
|
|
// Outcome of data policy notification: can be true or false.
|
2014-05-30 23:53:28 +00:00
|
|
|
POLICY_NOTIFICATION_SUCCESS("policynotification.success.1"),
|
2014-05-02 02:02:29 +00:00
|
|
|
|
2014-04-29 12:04:10 +00:00
|
|
|
// Sanitizing private data.
|
2014-05-30 23:53:28 +00:00
|
|
|
SANITIZE("sanitize.1"),
|
2014-05-02 02:10:08 +00:00
|
|
|
|
|
|
|
// Saving a resource (reader, bookmark, etc) for viewing later.
|
|
|
|
// Note: Only used in JavaScript for now, but here for completeness.
|
2014-05-30 23:53:28 +00:00
|
|
|
SAVE("save.1"),
|
2014-05-02 02:10:08 +00:00
|
|
|
|
2014-05-14 03:50:28 +00:00
|
|
|
// Sharing content.
|
2014-05-30 23:53:28 +00:00
|
|
|
SHARE("share.1"),
|
2014-04-02 04:33:21 +00:00
|
|
|
|
2014-05-15 19:13:39 +00:00
|
|
|
// Unpinning an item.
|
2014-05-30 23:53:28 +00:00
|
|
|
UNPIN("unpin.1"),
|
2014-05-14 03:50:28 +00:00
|
|
|
|
|
|
|
// Stop holding a resource (reader, bookmark, etc) for viewing later.
|
2014-05-08 02:53:50 +00:00
|
|
|
// Note: Only used in JavaScript for now, but here for completeness.
|
2014-05-30 23:53:28 +00:00
|
|
|
UNSAVE("unsave.1"),
|
2014-05-30 23:53:35 +00:00
|
|
|
|
|
|
|
// VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
|
|
|
|
_TEST1("_test_event_1.1"),
|
|
|
|
_TEST2("_test_event_2.1"),
|
|
|
|
_TEST3("_test_event_3.1"),
|
|
|
|
_TEST4("_test_event_4.1"),
|
2014-05-30 23:53:28 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
private final String string;
|
|
|
|
|
|
|
|
Event(final String string) {
|
|
|
|
this.string = string;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return string;
|
|
|
|
}
|
2014-04-10 02:06:01 +00:00
|
|
|
}
|
2014-03-28 22:36:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds event methods. Intended for use in
|
|
|
|
* Telemetry.sendUIEvent() as the "method" parameter.
|
2014-05-15 19:09:25 +00:00
|
|
|
*
|
|
|
|
* Please keep this list sorted.
|
2014-03-28 22:36:55 +00:00
|
|
|
*/
|
2014-05-30 23:53:28 +00:00
|
|
|
public enum Method {
|
2014-05-14 18:29:42 +00:00
|
|
|
// Action triggered from the action bar (including the toolbar).
|
2014-05-30 23:53:28 +00:00
|
|
|
ACTIONBAR("actionbar"),
|
2014-05-14 18:29:42 +00:00
|
|
|
|
|
|
|
// Action triggered by hitting the Android back button.
|
2014-05-30 23:53:28 +00:00
|
|
|
BACK("back"),
|
2014-05-14 18:29:42 +00:00
|
|
|
|
2014-05-02 02:02:29 +00:00
|
|
|
// Action triggered from a button.
|
2014-05-30 23:53:28 +00:00
|
|
|
BUTTON("button"),
|
2014-05-02 02:02:29 +00:00
|
|
|
|
2014-05-15 19:09:25 +00:00
|
|
|
// Action occurred via a context menu.
|
2014-05-30 23:53:28 +00:00
|
|
|
CONTEXT_MENU("contextmenu"),
|
2014-05-15 19:09:25 +00:00
|
|
|
|
2014-04-29 12:04:10 +00:00
|
|
|
// Action triggered from a dialog.
|
2014-05-30 23:53:28 +00:00
|
|
|
DIALOG("dialog"),
|
2014-04-02 04:33:21 +00:00
|
|
|
|
2014-05-15 19:09:25 +00:00
|
|
|
// Action triggered from a view grid item, like a thumbnail.
|
2014-05-30 23:53:28 +00:00
|
|
|
GRID_ITEM("griditem"),
|
2014-05-15 19:09:25 +00:00
|
|
|
|
2014-04-02 04:33:21 +00:00
|
|
|
// Action occurred via an intent.
|
2014-05-30 23:53:28 +00:00
|
|
|
INTENT("intent"),
|
2014-04-02 19:07:10 +00:00
|
|
|
|
2014-05-15 19:09:25 +00:00
|
|
|
// Action triggered from a list.
|
2014-05-30 23:53:28 +00:00
|
|
|
LIST("list"),
|
2014-04-02 19:07:10 +00:00
|
|
|
|
|
|
|
// Action triggered from a view list item, like a row of a list.
|
2014-05-30 23:53:28 +00:00
|
|
|
LIST_ITEM("listitem"),
|
2014-04-23 23:08:05 +00:00
|
|
|
|
2014-05-15 19:09:25 +00:00
|
|
|
// Action occurred via the main menu.
|
2014-05-30 23:53:28 +00:00
|
|
|
MENU("menu"),
|
|
|
|
|
|
|
|
// No method is specified.
|
|
|
|
NONE(null),
|
2014-05-08 02:53:50 +00:00
|
|
|
|
|
|
|
// Action triggered from a pageaction in the URLBar.
|
|
|
|
// Note: Only used in JavaScript for now, but here for completeness.
|
2014-05-30 23:53:28 +00:00
|
|
|
PAGEACTION("pageaction"),
|
2014-05-15 19:09:25 +00:00
|
|
|
|
|
|
|
// Action triggered from a suggestion provided to the user.
|
2014-05-30 23:53:28 +00:00
|
|
|
SUGGESTION("suggestion"),
|
2014-05-30 23:53:35 +00:00
|
|
|
|
|
|
|
// VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
|
|
|
|
_TEST1("_test_method_1"),
|
|
|
|
_TEST2("_test_method_2"),
|
2014-05-30 23:53:28 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
private final String string;
|
|
|
|
|
|
|
|
Method(final String string) {
|
|
|
|
this.string = string;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return string;
|
|
|
|
}
|
2014-04-29 12:04:10 +00:00
|
|
|
}
|
2014-03-28 22:36:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds session names. Intended for use with
|
|
|
|
* Telemetry.startUISession() as the "sessionName" parameter.
|
2014-05-15 19:09:25 +00:00
|
|
|
*
|
|
|
|
* Please keep this list sorted.
|
2014-03-28 22:36:55 +00:00
|
|
|
*/
|
2014-05-30 23:53:28 +00:00
|
|
|
public enum Session {
|
2014-05-14 18:29:42 +00:00
|
|
|
// Awesomescreen (including frecency search) is active.
|
2014-05-30 23:53:28 +00:00
|
|
|
AWESOMESCREEN("awesomescreen.1"),
|
2014-05-14 18:29:42 +00:00
|
|
|
|
2014-05-15 19:09:25 +00:00
|
|
|
// Started the very first time we believe the application has been launched.
|
2014-05-30 23:53:28 +00:00
|
|
|
FIRSTRUN("firstrun.1"),
|
2014-05-15 19:09:25 +00:00
|
|
|
|
|
|
|
// Awesomescreen frecency search is active.
|
2014-05-30 23:53:28 +00:00
|
|
|
FRECENCY("frecency.1"),
|
2014-05-15 19:09:25 +00:00
|
|
|
|
2014-03-28 22:36:55 +00:00
|
|
|
// Started when a user enters about:home.
|
2014-05-30 23:53:28 +00:00
|
|
|
HOME("home.1"),
|
2014-03-28 22:37:39 +00:00
|
|
|
|
|
|
|
// Started when a user enters a given home panel.
|
|
|
|
// Session name is dynamic, encoded as "homepanel.1:<panel_id>"
|
2014-05-30 23:53:28 +00:00
|
|
|
HOME_PANEL("homepanel.1"),
|
2014-05-02 02:10:08 +00:00
|
|
|
|
|
|
|
// Started when a Reader viewer becomes active in the foreground.
|
|
|
|
// Note: Only used in JavaScript for now, but here for completeness.
|
2014-05-30 23:53:28 +00:00
|
|
|
READER("reader.1"),
|
2014-05-30 23:53:35 +00:00
|
|
|
|
|
|
|
// VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
|
|
|
|
_TEST_STARTED_TWICE("_test_session_started_twice.1"),
|
|
|
|
_TEST_STOPPED_TWICE("_test_session_stopped_twice.1"),
|
2014-05-30 23:53:28 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
private final String string;
|
|
|
|
|
|
|
|
Session(final String string) {
|
|
|
|
this.string = string;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return string;
|
|
|
|
}
|
2014-03-28 22:36:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds reasons for stopping a session. Intended for use in
|
|
|
|
* Telemetry.stopUISession() as the "reason" parameter.
|
2014-05-15 19:09:25 +00:00
|
|
|
*
|
|
|
|
* Please keep this list sorted.
|
2014-03-28 22:36:55 +00:00
|
|
|
*/
|
2014-05-30 23:53:28 +00:00
|
|
|
public enum Reason {
|
2014-05-14 18:29:42 +00:00
|
|
|
// Changes were committed.
|
2014-05-30 23:53:28 +00:00
|
|
|
COMMIT("commit"),
|
|
|
|
|
|
|
|
// No reason is specified.
|
|
|
|
NONE(null),
|
2014-05-30 23:53:35 +00:00
|
|
|
|
|
|
|
// VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
|
|
|
|
_TEST1("_test_reason_1"),
|
|
|
|
_TEST2("_test_reason_2"),
|
|
|
|
_TEST_IGNORED("_test_reason_ignored"),
|
2014-05-30 23:53:28 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
private final String string;
|
|
|
|
|
|
|
|
Reason(final String string) {
|
|
|
|
this.string = string;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return string;
|
|
|
|
}
|
2014-05-14 18:29:42 +00:00
|
|
|
}
|
2014-03-28 22:36:55 +00:00
|
|
|
}
|