From 00280d3b65df844bf4db0cf7196ae3afbb31f229 Mon Sep 17 00:00:00 2001 From: mcarare Date: Fri, 10 Dec 2021 14:52:52 +0200 Subject: [PATCH] For #20513: Use UrlMetricType for search engine submission url. --- app/metrics.yaml | 7 ++++--- app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 2 +- .../test/java/org/mozilla/fenix/FenixApplicationTest.kt | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index 565578c31..2b1f413a4 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -1834,11 +1834,11 @@ search.default_engine: - android-probes@mozilla.com - erichards@mozilla.com expires: never - submission_url: - type: string + search_url: + type: url lifetime: application description: | - If the search engine is pre-loaded with Fenix this value will be he base + If the search engine is pre-loaded with Fenix this value will be the base URL we use to build the search query for the search engine. For example: https://mysearchengine.com/?query=%s. If it's a custom search engine (defined: https://github.com/mozilla-mobile/fenix/issues/1607) the value @@ -1847,6 +1847,7 @@ search.default_engine: - metrics bugs: - https://github.com/mozilla-mobile/fenix/issues/800 + - https://github.com/mozilla-mobile/fenix/issues/20513 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/1606 - https://github.com/mozilla-mobile/fenix/pull/5216 diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 04eb6ba8e..74f964c01 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -647,7 +647,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { SearchDefaultEngine.apply { code.set(searchEngine.id) name.set(searchEngine.name) - submissionUrl.set(searchEngine.buildSearchUrl("")) + searchUrl.set(searchEngine.buildSearchUrl("")) } } } diff --git a/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt b/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt index c5853086a..ad1cb3390 100644 --- a/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt +++ b/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt @@ -185,6 +185,6 @@ class FenixApplicationTest { // not mock most of the objects telemetry is collected from. assertFalse(SearchDefaultEngine.code.testHasValue()) assertFalse(SearchDefaultEngine.name.testHasValue()) - assertFalse(SearchDefaultEngine.submissionUrl.testHasValue()) + assertFalse(SearchDefaultEngine.searchUrl.testHasValue()) } }