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