diff --git a/app/metrics.yaml b/app/metrics.yaml index b002c368b..3c9b6a1d6 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -6047,12 +6047,12 @@ progressive_web_app: - https://github.com/mozilla-mobile/fenix/pull/18071 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - https://github.com/mozilla-mobile/fenix/pull/21076#issuecomment-909237275 + - https://github.com/mozilla-mobile/fenix/pull/23783#issuecomment-1041863879 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - - erichards@mozilla.com - expires: "2022-03-01" + expires: "2023-03-31" metadata: tags: - PWA @@ -6067,64 +6067,16 @@ progressive_web_app: - https://github.com/mozilla-mobile/fenix/pull/18071 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - https://github.com/mozilla-mobile/fenix/pull/21076#issuecomment-909237275 + - https://github.com/mozilla-mobile/fenix/pull/23783#issuecomment-1041863879 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - - erichards@mozilla.com - expires: "2022-03-01" - metadata: - tags: - - PWA - foreground: - type: event - description: | - A user brings the PWA into the foreground. - extra_keys: - time_ms: - description: | - The current time in ms when the PWA was brought to the foreground. - bugs: - - https://github.com/mozilla-mobile/fenix/issues/10261 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/11859 - - https://github.com/mozilla-mobile/fenix/pull/18071 - - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - - https://github.com/mozilla-mobile/fenix/pull/21076#issuecomment-909237275 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - - erichards@mozilla.com - expires: "2022-03-01" + expires: "2023-03-31" metadata: tags: - PWA - background: - type: event - description: | - A user puts the PWA into the background. - extra_keys: - time_ms: - description: | - The current time in ms when the PWA was backgrounded. - bugs: - - https://github.com/mozilla-mobile/fenix/issues/10261 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/11859 - - https://github.com/mozilla-mobile/fenix/pull/18071 - - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - - https://github.com/mozilla-mobile/fenix/pull/21076#issuecomment-909237275 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - - erichards@mozilla.com - expires: "2022-03-01" - metadata: - tags: - - PWA tabs: setting_opened: type: event diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt index e0c99a7dc..968ba01c7 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt @@ -9,7 +9,6 @@ import mozilla.components.browser.errorpages.ErrorType import mozilla.components.browser.state.search.SearchEngine import mozilla.components.feature.top.sites.TopSite import org.mozilla.fenix.GleanMetrics.Addons -import org.mozilla.fenix.GleanMetrics.AndroidKeystoreExperiment import org.mozilla.fenix.GleanMetrics.AppTheme import org.mozilla.fenix.GleanMetrics.Autoplay import org.mozilla.fenix.GleanMetrics.Collections @@ -21,7 +20,6 @@ import org.mozilla.fenix.GleanMetrics.Logins import org.mozilla.fenix.GleanMetrics.Onboarding import org.mozilla.fenix.GleanMetrics.Pocket import org.mozilla.fenix.GleanMetrics.Preferences -import org.mozilla.fenix.GleanMetrics.ProgressiveWebApp import org.mozilla.fenix.GleanMetrics.SearchShortcuts import org.mozilla.fenix.GleanMetrics.SearchTerms import org.mozilla.fenix.GleanMetrics.TabsTray @@ -332,40 +330,11 @@ sealed class Event { get() = hashMapOf(TopSites.swipeCarouselKeys.page to page.toString()) } - data class SecurePrefsExperimentFailure(val failureException: String) : Event() { - override val extras = - mapOf(AndroidKeystoreExperiment.experimentFailureKeys.failureException to failureException) - } - data class SecurePrefsGetFailure(val failureException: String) : Event() { - override val extras = - mapOf(AndroidKeystoreExperiment.getFailureKeys.failureException to failureException) - } - data class SecurePrefsGetSuccess(val successCode: String) : Event() { - override val extras = - mapOf(AndroidKeystoreExperiment.getResultKeys.result to successCode) - } - data class SecurePrefsWriteFailure(val failureException: String) : Event() { - override val extras = - mapOf(AndroidKeystoreExperiment.writeFailureKeys.failureException to failureException) - } - object SecurePrefsWriteSuccess : Event() - object SecurePrefsReset : Event() - data class TopSiteLongPress(val topSite: TopSite) : Event() { override val extras: Map? get() = hashMapOf(TopSites.longPressKeys.type to topSite.name()) } - data class ProgressiveWebAppForeground(val timeForegrounded: Long) : Event() { - override val extras: Map? - get() = mapOf(ProgressiveWebApp.foregroundKeys.timeMs to timeForegrounded.toString()) - } - - data class ProgressiveWebAppBackground(val timeBackgrounded: Long) : Event() { - override val extras: Map? - get() = mapOf(ProgressiveWebApp.backgroundKeys.timeMs to timeBackgrounded.toString()) - } - data class OnboardingToolbarPosition(val position: Position) : Event() { enum class Position { TOP, BOTTOM } diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index 901a00113..3844aacfc 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -10,7 +10,6 @@ import mozilla.components.service.glean.private.NoExtraKeys import mozilla.components.support.base.log.logger.Logger import org.mozilla.fenix.GleanMetrics.Addons import org.mozilla.fenix.GleanMetrics.AndroidAutofill -import org.mozilla.fenix.GleanMetrics.AndroidKeystoreExperiment import org.mozilla.fenix.GleanMetrics.AppTheme import org.mozilla.fenix.GleanMetrics.Autoplay import org.mozilla.fenix.GleanMetrics.Awesomebar @@ -728,14 +727,6 @@ private val Event.wrapper: EventWrapper<*>? is Event.ProgressiveWebAppInstallAsShortcut -> EventWrapper( { ProgressiveWebApp.installTap.record(it) } ) - is Event.ProgressiveWebAppForeground -> EventWrapper( - { ProgressiveWebApp.foreground.record(it) }, - { ProgressiveWebApp.foregroundKeys.valueOf(it) } - ) - is Event.ProgressiveWebAppBackground -> EventWrapper( - { ProgressiveWebApp.background.record(it) }, - { ProgressiveWebApp.backgroundKeys.valueOf(it) } - ) is Event.CopyUrlUsed -> EventWrapper( { Events.copyUrlTapped.record(it) } ) @@ -792,28 +783,6 @@ private val Event.wrapper: EventWrapper<*>? { Awesomebar.openedTabSuggestionClicked.record(it) } ) - is Event.SecurePrefsExperimentFailure -> EventWrapper( - { AndroidKeystoreExperiment.experimentFailure.record(it) }, - { AndroidKeystoreExperiment.experimentFailureKeys.valueOf(it) } - ) - is Event.SecurePrefsGetFailure -> EventWrapper( - { AndroidKeystoreExperiment.getFailure.record(it) }, - { AndroidKeystoreExperiment.getFailureKeys.valueOf(it) } - ) - is Event.SecurePrefsGetSuccess -> EventWrapper( - { AndroidKeystoreExperiment.getResult.record(it) }, - { AndroidKeystoreExperiment.getResultKeys.valueOf(it) } - ) - is Event.SecurePrefsWriteFailure -> EventWrapper( - { AndroidKeystoreExperiment.writeFailure.record(it) }, - { AndroidKeystoreExperiment.writeFailureKeys.valueOf(it) } - ) - is Event.SecurePrefsWriteSuccess -> EventWrapper( - { AndroidKeystoreExperiment.writeSuccess.record(it) } - ) - is Event.SecurePrefsReset -> EventWrapper( - { AndroidKeystoreExperiment.reset.record(it) } - ) is Event.HomeMenuSettingsItemClicked -> EventWrapper( { HomeMenu.settingsItemClicked.record(it) } ) diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt index 5d38e8c47..3380b9cb8 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt @@ -26,7 +26,6 @@ import mozilla.components.feature.search.telemetry.ads.AdsTelemetry import mozilla.components.feature.search.telemetry.incontent.InContentTelemetry import mozilla.components.feature.syncedtabs.facts.SyncedTabsFacts import mozilla.components.feature.top.sites.facts.TopSitesFacts -import mozilla.components.lib.dataprotect.SecurePrefsReliabilityExperiment import mozilla.components.support.base.Component import mozilla.components.support.base.facts.Action import mozilla.components.support.base.facts.Fact @@ -287,28 +286,6 @@ internal class ReleaseMetricController( Component.FEATURE_AWESOMEBAR == component && AwesomeBarFacts.Items.OPENED_TAB_SUGGESTION_CLICKED == item -> { Event.OpenedTabSuggestionClicked } - - Component.LIB_DATAPROTECT == component && SecurePrefsReliabilityExperiment.Companion.Actions.EXPERIMENT == item -> { - Event.SecurePrefsExperimentFailure(metadata?.get("javaClass") as String? ?: "null") - } - Component.LIB_DATAPROTECT == component && SecurePrefsReliabilityExperiment.Companion.Actions.GET == item -> { - if (SecurePrefsReliabilityExperiment.Companion.Values.FAIL.v == value?.toInt()) { - Event.SecurePrefsGetFailure(metadata?.get("javaClass") as String? ?: "null") - } else { - Event.SecurePrefsGetSuccess(value ?: "") - } - } - Component.LIB_DATAPROTECT == component && SecurePrefsReliabilityExperiment.Companion.Actions.WRITE == item -> { - if (SecurePrefsReliabilityExperiment.Companion.Values.FAIL.v == value?.toInt()) { - Event.SecurePrefsWriteFailure(metadata?.get("javaClass") as String? ?: "null") - } else { - Event.SecurePrefsWriteSuccess - } - } - Component.LIB_DATAPROTECT == component && SecurePrefsReliabilityExperiment.Companion.Actions.RESET == item -> { - Event.SecurePrefsReset - } - Component.FEATURE_SEARCH == component && AdsTelemetry.SERP_ADD_CLICKED == item -> { Event.SearchAdClicked(value!!) } diff --git a/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt index 6a052462a..5d6ca269f 100644 --- a/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserFragment.kt @@ -6,7 +6,6 @@ package org.mozilla.fenix.customtabs import android.content.Context import android.content.Intent -import android.os.SystemClock import android.view.View import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.view.isVisible @@ -30,7 +29,6 @@ import org.mozilla.fenix.R import org.mozilla.fenix.browser.BaseBrowserFragment import org.mozilla.fenix.browser.CustomTabContextMenuCandidate import org.mozilla.fenix.browser.FenixSnackbarDelegate -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.requireComponents @@ -156,22 +154,6 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler } } - override fun onResume() { - super.onResume() - val currTimeMs = SystemClock.elapsedRealtimeNanos() / MS_PRECISION - requireComponents.analytics.metrics.track( - Event.ProgressiveWebAppForeground(currTimeMs) - ) - } - - override fun onPause() { - super.onPause() - val currTimeMs = SystemClock.elapsedRealtimeNanos() / MS_PRECISION - requireComponents.analytics.metrics.track( - Event.ProgressiveWebAppBackground(currTimeMs) - ) - } - override fun removeSessionIfNeeded(): Boolean { return customTabsIntegration.onBackPressed() || super.removeSessionIfNeeded() } diff --git a/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt b/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt index d113faf4f..7219cc95d 100644 --- a/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt @@ -17,7 +17,6 @@ import mozilla.components.feature.prompts.facts.CreditCardAutofillDialogFacts import mozilla.components.feature.pwa.ProgressiveWebAppFacts import mozilla.components.feature.syncedtabs.facts.SyncedTabsFacts import mozilla.components.feature.top.sites.facts.TopSitesFacts -import mozilla.components.lib.dataprotect.SecurePrefsReliabilityExperiment import mozilla.components.support.base.Component import mozilla.components.support.base.facts.Action import mozilla.components.support.base.facts.Fact @@ -528,7 +527,6 @@ class MetricControllerTest { Triple(Component.FEATURE_AWESOMEBAR, AwesomeBarFacts.Items.SEARCH_ACTION_CLICKED, Event.SearchActionClicked), Triple(Component.FEATURE_AWESOMEBAR, AwesomeBarFacts.Items.SEARCH_SUGGESTION_CLICKED, Event.SearchSuggestionClicked), Triple(Component.FEATURE_AWESOMEBAR, AwesomeBarFacts.Items.OPENED_TAB_SUGGESTION_CLICKED, Event.OpenedTabSuggestionClicked), - Triple(Component.LIB_DATAPROTECT, SecurePrefsReliabilityExperiment.Companion.Actions.RESET, Event.SecurePrefsReset), ) simpleMappings.forEach { (component, item, expectedEvent) ->