1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/TelemetryContract.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,138 @@ 1.4 +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +package org.mozilla.gecko; 1.10 + 1.11 +/** 1.12 + * Holds data definitions for our UI Telemetry implementation. 1.13 + */ 1.14 +public interface TelemetryContract { 1.15 + 1.16 + /** 1.17 + * Holds event names. Intended for use with 1.18 + * Telemetry.sendUIEvent() as the "action" parameter. 1.19 + */ 1.20 + public interface Event { 1.21 + // Cancel a state, action, etc. 1.22 + public static final String CANCEL = "cancel.1"; 1.23 + 1.24 + // Outcome of data policy notification: can be true or false. 1.25 + public static final String POLICY_NOTIFICATION_SUCCESS = "policynotification.success.1:"; 1.26 + 1.27 + // Top site pinned. 1.28 + public static final String TOP_SITES_PIN = "pin.1"; 1.29 + 1.30 + // Top site un-pinned. 1.31 + public static final String TOP_SITES_UNPIN = "unpin.1"; 1.32 + 1.33 + // Top site edited. 1.34 + public static final String TOP_SITES_EDIT = "edit.1"; 1.35 + 1.36 + // Set default panel. 1.37 + public static final String PANEL_SET_DEFAULT = "setdefault.1"; 1.38 + 1.39 + // Sharing content. 1.40 + public static final String SHARE = "share.1"; 1.41 + 1.42 + // Sanitizing private data. 1.43 + public static final String SANITIZE = "sanitize.1"; 1.44 + 1.45 + // Saving a resource (reader, bookmark, etc) for viewing later. 1.46 + // Note: Only used in JavaScript for now, but here for completeness. 1.47 + public static final String SAVE = "save.1"; 1.48 + 1.49 + // Stop holding a resource (reader, bookmark, etc) for viewing later. 1.50 + // Note: Only used in JavaScript for now, but here for completeness. 1.51 + public static final String UNSAVE = "unsave.1"; 1.52 + 1.53 + // Loading a URL. 1.54 + public static final String LOAD_URL = "loadurl.1"; 1.55 + 1.56 + // Generic action, usually for tracking menu and toolbar actions. 1.57 + public static final String ACTION = "action.1"; 1.58 + 1.59 + // Launching (opening) an external application 1.60 + // Note: Only used in JavaScript for now, but here for completeness. 1.61 + public static final String LAUNCH = "launch.1"; 1.62 + } 1.63 + 1.64 + /** 1.65 + * Holds event methods. Intended for use in 1.66 + * Telemetry.sendUIEvent() as the "method" parameter. 1.67 + */ 1.68 + public interface Method { 1.69 + // Action triggered from a list. 1.70 + public static final String LIST = "list"; 1.71 + 1.72 + // Action triggered from the action bar (including the toolbar). 1.73 + public static final String ACTIONBAR = "actionbar"; 1.74 + 1.75 + // Action triggered by hitting the Android back button. 1.76 + public static final String BACK = "back"; 1.77 + 1.78 + // Action triggered from a button. 1.79 + public static final String BUTTON = "button"; 1.80 + 1.81 + // Action triggered from a dialog. 1.82 + public static final String DIALOG = "dialog"; 1.83 + 1.84 + // Action occurred via an intent. 1.85 + public static final String INTENT = "intent"; 1.86 + 1.87 + // Action occurred via the main menu. 1.88 + public static final String MENU = "menu"; 1.89 + 1.90 + // Action occurred via a context menu. 1.91 + public static final String CONTEXT_MENU = "contextmenu"; 1.92 + 1.93 + // Action triggered from a view grid item, like a thumbnail. 1.94 + public static final String GRID_ITEM = "griditem"; 1.95 + 1.96 + // Action triggered from a view list item, like a row of a list. 1.97 + public static final String LIST_ITEM = "listitem"; 1.98 + 1.99 + // Action triggered from a suggestion provided to the user. 1.100 + public static final String SUGGESTION = "suggestion"; 1.101 + 1.102 + // Action triggered from a pageaction in the URLBar. 1.103 + // Note: Only used in JavaScript for now, but here for completeness. 1.104 + public static final String PAGEACTION = "pageaction"; 1.105 + } 1.106 + 1.107 + /** 1.108 + * Holds session names. Intended for use with 1.109 + * Telemetry.startUISession() as the "sessionName" parameter. 1.110 + */ 1.111 + public interface Session { 1.112 + // Awesomescreen (including frecency search) is active. 1.113 + public static final String AWESOMESCREEN = "awesomescreen.1"; 1.114 + 1.115 + // Started when a user enters about:home. 1.116 + public static final String HOME = "home.1"; 1.117 + 1.118 + // Started when a user enters a given home panel. 1.119 + // Session name is dynamic, encoded as "homepanel.1:<panel_id>" 1.120 + public static final String HOME_PANEL = "homepanel.1:"; 1.121 + 1.122 + // Started when a Reader viewer becomes active in the foreground. 1.123 + // Note: Only used in JavaScript for now, but here for completeness. 1.124 + public static final String READER = "reader.1"; 1.125 + 1.126 + // Awesomescreen frecency search is active. 1.127 + public static final String FRECENCY = "frecency.1"; 1.128 + 1.129 + // Started the very first time we believe the application has been launched. 1.130 + public static final String FIRSTRUN = "firstrun.1"; 1.131 + } 1.132 + 1.133 + /** 1.134 + * Holds reasons for stopping a session. Intended for use in 1.135 + * Telemetry.stopUISession() as the "reason" parameter. 1.136 + */ 1.137 + public interface Reason { 1.138 + // Changes were committed. 1.139 + public static final String COMMIT = "commit"; 1.140 + } 1.141 +}