mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1256415 - Replace FENNEC_GECKOAPP_STARTUP_ACTION histogram with UI telemetry. r=mfinkle a=ritu
MozReview-Commit-ID: ElmELmp7baV
This commit is contained in:
parent
d280f47ff7
commit
9ece805213
@ -4123,17 +4123,23 @@ public class BrowserApp extends GeckoApp
|
||||
}
|
||||
|
||||
@Override
|
||||
protected StartupAction getStartupAction(final String passedURL, final String action) {
|
||||
final boolean inGuestMode = GeckoProfile.get(this).inGuestMode();
|
||||
if (inGuestMode) {
|
||||
return StartupAction.GUEST;
|
||||
}
|
||||
if (Restrictions.isRestrictedProfile(this)) {
|
||||
return StartupAction.RESTRICTED;
|
||||
}
|
||||
protected void recordStartupActionTelemetry(final String passedURL, final String action) {
|
||||
final TelemetryContract.Method method;
|
||||
if (ACTION_HOMESCREEN_SHORTCUT.equals(action)) {
|
||||
return StartupAction.SHORTCUT;
|
||||
// This action is also recorded via "loadurl.1" > "homescreen".
|
||||
method = TelemetryContract.Method.HOMESCREEN;
|
||||
} else if (passedURL == null) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH, TelemetryContract.Method.HOMESCREEN, "launcher");
|
||||
method = TelemetryContract.Method.HOMESCREEN;
|
||||
} else {
|
||||
// This is action is also recorded via "loadurl.1" > "intent".
|
||||
method = TelemetryContract.Method.INTENT;
|
||||
}
|
||||
|
||||
if (GeckoProfile.get(this).inGuestMode()) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH, method, "guest");
|
||||
} else if (Restrictions.isRestrictedProfile(this)) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH, method, "restricted");
|
||||
}
|
||||
return (passedURL == null ? StartupAction.NORMAL : StartupAction.URL);
|
||||
}
|
||||
}
|
||||
|
@ -138,15 +138,6 @@ public abstract class GeckoApp
|
||||
private static final String LOGTAG = "GeckoApp";
|
||||
private static final int ONE_DAY_MS = 1000*60*60*24;
|
||||
|
||||
public enum StartupAction {
|
||||
NORMAL, /* normal application start */
|
||||
URL, /* launched with a passed URL */
|
||||
PREFETCH, /* launched with a passed URL that we prefetch */
|
||||
GUEST, /* launched in guest browsing */
|
||||
RESTRICTED, /* launched with restricted profile */
|
||||
SHORTCUT /* launched from a homescreen shortcut */
|
||||
}
|
||||
|
||||
public static final String ACTION_ALERT_CALLBACK = "org.mozilla.gecko.ACTION_ALERT_CALLBACK";
|
||||
public static final String ACTION_HOMESCREEN_SHORTCUT = "org.mozilla.gecko.BOOKMARK";
|
||||
public static final String ACTION_DEBUG = "org.mozilla.gecko.DEBUG";
|
||||
@ -1585,8 +1576,7 @@ public abstract class GeckoApp
|
||||
getProfile().moveSessionFile();
|
||||
}
|
||||
|
||||
final StartupAction startupAction = getStartupAction(passedUri, action);
|
||||
Telemetry.addToHistogram("FENNEC_GECKOAPP_STARTUP_ACTION", startupAction.ordinal());
|
||||
recordStartupActionTelemetry(passedUri, action);
|
||||
|
||||
// Check if launched from data reporting notification.
|
||||
if (ACTION_LAUNCH_SETTINGS.equals(action)) {
|
||||
@ -1939,8 +1929,7 @@ public abstract class GeckoApp
|
||||
startActivity(settingsIntent);
|
||||
}
|
||||
|
||||
final StartupAction startupAction = getStartupAction(passedUri, action);
|
||||
Telemetry.addToHistogram("FENNEC_GECKOAPP_STARTUP_ACTION", startupAction.ordinal());
|
||||
recordStartupActionTelemetry(passedUri, action);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2754,8 +2743,6 @@ public abstract class GeckoApp
|
||||
return new StubbedHealthRecorder();
|
||||
}
|
||||
|
||||
protected StartupAction getStartupAction(final String passedURL, final String action) {
|
||||
// Default to NORMAL here. Subclasses can handle the other types.
|
||||
return StartupAction.NORMAL;
|
||||
protected void recordStartupActionTelemetry(final String passedURL, final String action) {
|
||||
}
|
||||
}
|
||||
|
@ -5184,13 +5184,6 @@
|
||||
"description": "Time for a URL bar DB search to return (ms)",
|
||||
"cpp_guard": "ANDROID"
|
||||
},
|
||||
"FENNEC_GECKOAPP_STARTUP_ACTION": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "The way the GeckoApp was launched. (Normal, URL, Prefetch, WebApp, Guest, Restricted, Shortcut)",
|
||||
"cpp_guard": "ANDROID"
|
||||
},
|
||||
"FENNEC_RESTRICTED_PROFILE_RESTRICTIONS": {
|
||||
"expires_in_version": "50",
|
||||
"kind": "enumerated",
|
||||
|
Loading…
Reference in New Issue
Block a user