From bce60f9d82d2172d4e1047d6f36911d6f62eff77 Mon Sep 17 00:00:00 2001 From: Daosheng Mu Date: Tue, 7 Apr 2020 16:49:24 -0700 Subject: [PATCH] Call Glean initialize prior to set startup metrtics. (#3130) --- .../org/mozilla/vrbrowser/telemetry/GleanMetricsService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java b/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java index dbceba2f4..b4121964c 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java @@ -46,13 +46,14 @@ public static void init(Context aContext) { initialized = true; final boolean telemetryEnabled = SettingsStore.getInstance(aContext).isTelemetryEnabled(); + Configuration config = new Configuration(Configuration.DEFAULT_TELEMETRY_ENDPOINT, BuildConfig.BUILD_TYPE); + Glean.INSTANCE.initialize(aContext, telemetryEnabled, config); + if (telemetryEnabled) { GleanMetricsService.start(); } else { GleanMetricsService.stop(); } - Configuration config = new Configuration(Configuration.DEFAULT_TELEMETRY_ENDPOINT, BuildConfig.BUILD_TYPE); - Glean.INSTANCE.initialize(aContext, true, config); } // It would be called when users turn on/off the setting of telemetry.