For #960 - Adds metrics to measure if Fenix is the default browser
parent
0acf8698ef
commit
0e9400730b
|
@ -0,0 +1,20 @@
|
||||||
|
# This file defines the metrics that are recorded by glean telemetry. They are
|
||||||
|
# automatically converted to Kotlin code at build time using the `glean_parser`
|
||||||
|
# PyPI package.
|
||||||
|
|
||||||
|
$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
default_browser:
|
||||||
|
type: boolean
|
||||||
|
description: >
|
||||||
|
Is Fenix the default browser?
|
||||||
|
send_in_pings:
|
||||||
|
- metrics
|
||||||
|
bugs:
|
||||||
|
- 123456789
|
||||||
|
data_reviews:
|
||||||
|
- N/A
|
||||||
|
notification_emails:
|
||||||
|
- telemetry-client-dev@mozilla.com
|
||||||
|
expires: never
|
|
@ -5,13 +5,19 @@ package org.mozilla.fenix.components.metrics
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import mozilla.components.service.glean.Glean
|
import mozilla.components.service.glean.Glean
|
||||||
|
import mozilla.components.support.utils.Browsers
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.utils.Settings
|
import org.mozilla.fenix.utils.Settings
|
||||||
|
import org.mozilla.fenix.debug.GleanMetrics.Metrics
|
||||||
|
|
||||||
class GleanMetricsService(private val context: Context) : MetricsService {
|
class GleanMetricsService(private val context: Context) : MetricsService {
|
||||||
override fun start() {
|
override fun start() {
|
||||||
Glean.initialize(context)
|
Glean.initialize(context)
|
||||||
Glean.setUploadEnabled(IsGleanEnabled)
|
Glean.setUploadEnabled(IsGleanEnabled)
|
||||||
|
|
||||||
|
Metrics.apply {
|
||||||
|
defaultBrowser.set(Browsers.all(context).isDefaultBrowser)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun track(event: Event) { }
|
override fun track(event: Event) { }
|
||||||
|
|
Loading…
Reference in New Issue