1
0
Fork 0

For #960 - Adds metrics to measure if Fenix is the default browser

master
Jeff Boek 2019-03-18 13:30:25 -07:00
parent 0acf8698ef
commit 0e9400730b
2 changed files with 26 additions and 0 deletions

20
app/metrics.yaml 100644
View File

@ -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

View File

@ -5,13 +5,19 @@ package org.mozilla.fenix.components.metrics
import android.content.Context
import mozilla.components.service.glean.Glean
import mozilla.components.support.utils.Browsers
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.utils.Settings
import org.mozilla.fenix.debug.GleanMetrics.Metrics
class GleanMetricsService(private val context: Context) : MetricsService {
override fun start() {
Glean.initialize(context)
Glean.setUploadEnabled(IsGleanEnabled)
Metrics.apply {
defaultBrowser.set(Browsers.all(context).isDefaultBrowser)
}
}
override fun track(event: Event) { }