mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 813677 - Only send about:home telemetry pings when showing about:home. r=mfinkle
This commit is contained in:
parent
892e4e85b0
commit
fe69ddea28
@ -58,6 +58,7 @@ abstract public class BrowserApp extends GeckoApp
|
||||
public static BrowserToolbar mBrowserToolbar;
|
||||
private AboutHomeContent mAboutHomeContent;
|
||||
private Boolean mAboutHomeShowing = null;
|
||||
protected Telemetry.Timer mAboutHomeStartupTimer = null;
|
||||
|
||||
private static final int ADDON_MENU_OFFSET = 1000;
|
||||
private class MenuItemInfo {
|
||||
@ -202,6 +203,8 @@ abstract public class BrowserApp extends GeckoApp
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
mAboutHomeStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_ABOUTHOME");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
LinearLayout actionBar = (LinearLayout) getActionBarLayout();
|
||||
@ -271,10 +274,12 @@ abstract public class BrowserApp extends GeckoApp
|
||||
Tab tab = Tabs.getInstance().loadUrl("about:home", Tabs.LOADURL_NEW_TAB);
|
||||
} else {
|
||||
hideAboutHome();
|
||||
mAboutHomeStartupTimer.cancel();
|
||||
}
|
||||
} else {
|
||||
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED;
|
||||
Tabs.getInstance().loadUrl(uri, flags);
|
||||
mAboutHomeStartupTimer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@ -670,9 +675,9 @@ abstract public class BrowserApp extends GeckoApp
|
||||
}
|
||||
});
|
||||
mAboutHomeContent.setLoadCompleteCallback(new AboutHomeContent.VoidCallback() {
|
||||
public void callback() {
|
||||
mAboutHomeStartupTimer.stop();
|
||||
}
|
||||
public void callback() {
|
||||
mAboutHomeStartupTimer.stop();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mAboutHomeContent.update(EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES,
|
||||
|
@ -190,7 +190,6 @@ abstract public class GeckoApp
|
||||
|
||||
protected int mRestoreMode = RESTORE_NONE;
|
||||
protected boolean mInitialized = false;
|
||||
protected Telemetry.Timer mAboutHomeStartupTimer;
|
||||
private Telemetry.Timer mJavaUiStartupTimer;
|
||||
private Telemetry.Timer mGeckoReadyStartupTimer;
|
||||
|
||||
@ -1470,7 +1469,6 @@ abstract public class GeckoApp
|
||||
|
||||
// The clock starts...now. Better hurry!
|
||||
mJavaUiStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_JAVAUI");
|
||||
mAboutHomeStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_ABOUTHOME");
|
||||
mGeckoReadyStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_GECKOREADY");
|
||||
|
||||
((GeckoApplication)getApplication()).initialize();
|
||||
|
@ -27,8 +27,6 @@ public class Telemetry {
|
||||
GeckoEvent event =
|
||||
GeckoEvent.createBroadcastEvent("Telemetry:Add", jsonData.toString());
|
||||
GeckoAppShell.sendEventToGecko(event);
|
||||
|
||||
Log.v(LOGTAG, "Sending telemetry: " + jsonData.toString());
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOGTAG, "JSON exception: ", e);
|
||||
}
|
||||
@ -45,6 +43,10 @@ public class Telemetry {
|
||||
mHasFinished = false;
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
mHasFinished = true;
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
// Only the first stop counts.
|
||||
if (mHasFinished) {
|
||||
|
Loading…
Reference in New Issue
Block a user