Bug 1245497 - (Part 1) Update FENNEC_GECKOAPP_STARTUP_ACTION to measure homescreen shortcut launches. r=mcomella

MozReview-Commit-ID: CkvS3eP5wTy

--HG--
extra : rebase_source : 6a03986c6e2bbd53238bc6beb6083023d83bd124
This commit is contained in:
Margaret Leibovic 2016-02-03 12:08:15 -05:00
Родитель 5a7bf7c7b3
Коммит ead971820b
4 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -4000,7 +4000,7 @@ public class BrowserApp extends GeckoApp
}
@Override
protected StartupAction getStartupAction(final String passedURL) {
protected StartupAction getStartupAction(final String passedURL, final String action) {
final boolean inGuestMode = GeckoProfile.get(this).inGuestMode();
if (inGuestMode) {
return StartupAction.GUEST;
@ -4008,6 +4008,9 @@ public class BrowserApp extends GeckoApp
if (Restrictions.isRestrictedProfile(this)) {
return StartupAction.RESTRICTED;
}
if (ACTION_HOMESCREEN_SHORTCUT.equals(action)) {
return StartupAction.SHORTCUT;
}
return (passedURL == null ? StartupAction.NORMAL : StartupAction.URL);
}
}

Просмотреть файл

@ -140,13 +140,14 @@ public abstract class GeckoApp
private static final String LOGTAG = "GeckoApp";
private static final int ONE_DAY_MS = 1000*60*60*24;
public static enum StartupAction {
public enum StartupAction {
NORMAL, /* normal application start */
URL, /* launched with a passed URL */
PREFETCH, /* launched with a passed URL that we prefetch */
WEBAPP, /* launched as a webapp runtime */
GUEST, /* launched in guest browsing */
RESTRICTED /* launched with restricted profile */
RESTRICTED, /* launched with restricted profile */
SHORTCUT /* launched from a homescreen shortcut */
}
public static final String ACTION_ALERT_CALLBACK = "org.mozilla.gecko.ACTION_ALERT_CALLBACK";
@ -1588,7 +1589,7 @@ public abstract class GeckoApp
getProfile().moveSessionFile();
}
final StartupAction startupAction = getStartupAction(passedUri);
final StartupAction startupAction = getStartupAction(passedUri, action);
Telemetry.addToHistogram("FENNEC_GECKOAPP_STARTUP_ACTION", startupAction.ordinal());
// Check if launched from data reporting notification.
@ -2768,7 +2769,7 @@ public abstract class GeckoApp
return new StubbedHealthRecorder();
}
protected StartupAction getStartupAction(final String passedURL) {
protected StartupAction getStartupAction(final String passedURL, final String action) {
// Default to NORMAL here. Subclasses can handle the other types.
return StartupAction.NORMAL;
}

Просмотреть файл

@ -407,7 +407,7 @@ public class WebappImpl extends GeckoApp implements InstallCallback {
}
@Override
protected StartupAction getStartupAction(final String passedURL) {
protected StartupAction getStartupAction(final String passedURL, final String action) {
return StartupAction.WEBAPP;
}
}

Просмотреть файл

@ -5155,7 +5155,7 @@
"expires_in_version": "never",
"kind": "enumerated",
"n_values": 10,
"description": "The way the GeckoApp was launched. (Normal, URL, Prefetch, WebApp, Guest, Restricted)",
"description": "The way the GeckoApp was launched. (Normal, URL, Prefetch, WebApp, Guest, Restricted, Shortcut)",
"cpp_guard": "ANDROID"
},
"FENNEC_RESTRICTED_PROFILE_RESTRICTIONS": {