diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 8783333fe9..ed841f6dcf 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -100,7 +100,6 @@ import org.mozilla.fenix.browser.readermode.DefaultReaderModeController import org.mozilla.fenix.components.FenixSnackbar import org.mozilla.fenix.components.FindInPageIntegration import org.mozilla.fenix.components.StoreProvider -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.components.toolbar.BrowserFragmentState import org.mozilla.fenix.components.toolbar.BrowserFragmentStore import org.mozilla.fenix.components.toolbar.BrowserToolbarView @@ -1275,8 +1274,6 @@ abstract class BaseBrowserFragment : ) withContext(Main) { - requireComponents.analytics.metrics.track(Event.AddBookmark) - view?.let { FenixSnackbar.make( view = binding.browserLayout, @@ -1298,7 +1295,6 @@ abstract class BaseBrowserFragment : } } catch (e: PlacesException.UrlParseFailed) { withContext(Main) { - requireComponents.analytics.metrics.track(Event.AddBookmark) view?.let { FenixSnackbar.make( 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 48895c48c7..6e72768bda 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 @@ -7,14 +7,8 @@ package org.mozilla.fenix.components.metrics sealed class Event { // Interaction Events - object OpenedAppFirstRun : Event() - object InteractWithSearchURLArea : Event() - object DismissedOnboarding : Event() - object ClearedPrivateData : Event() - object AddBookmark : Event() object HistoryHighlightOpened : Event() object HistorySearchGroupOpened : Event() - object SearchWidgetInstalled : Event() // Interaction events with extras 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 ca0633a533..183ae6a7e8 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 @@ -126,14 +126,6 @@ private val Event.wrapper: EventWrapper<*>? is Event.HistorySearchGroupOpened -> EventWrapper( { RecentlyVisitedHomepage.searchGroupOpened.record() } ) - - // Don't record other events in Glean: - is Event.AddBookmark -> null - is Event.OpenedAppFirstRun -> null - is Event.InteractWithSearchURLArea -> null - is Event.ClearedPrivateData -> null - is Event.DismissedOnboarding -> null - is Event.SearchWidgetInstalled -> null } /** diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index d002835af1..cfd1bfd8af 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -91,7 +91,6 @@ import org.mozilla.fenix.components.PrivateShortcutCreateManager import org.mozilla.fenix.components.TabCollectionStorage import org.mozilla.fenix.components.accounts.AccountState import org.mozilla.fenix.components.appstate.AppAction -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.components.toolbar.FenixTabCounterMenu import org.mozilla.fenix.components.toolbar.ToolbarPosition import org.mozilla.fenix.databinding.FragmentHomeBinding @@ -208,11 +207,6 @@ class HomeFragment : Fragment() { super.onCreate(savedInstanceState) bundleArgs = args.toBundle() - lifecycleScope.launch(IO) { - if (!onboarding.userHasBeenOnboarded()) { - requireComponents.analytics.metrics.track(Event.OpenedAppFirstRun) - } - } if (!onboarding.userHasBeenOnboarded() && requireContext().settings().shouldShowPrivacyPopWindow && diff --git a/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt b/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt index c9cfff8d9e..91033bab54 100644 --- a/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt +++ b/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt @@ -10,7 +10,6 @@ import android.os.StrictMode import androidx.annotation.VisibleForTesting import mozilla.components.support.ktx.android.content.PreferencesHolder import mozilla.components.support.ktx.android.content.intPreference -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.components class FenixOnboarding(context: Context) : PreferencesHolder { @@ -28,7 +27,6 @@ class FenixOnboarding(context: Context) : PreferencesHolder { fun finish() { onboardedVersion = CURRENT_ONBOARDING_VERSION - metrics.track(Event.DismissedOnboarding) } fun userHasBeenOnboarded(): Boolean { diff --git a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt index b3b56a3e98..86ae95771d 100644 --- a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt @@ -69,7 +69,6 @@ import org.mozilla.fenix.GleanMetrics.Awesomebar import org.mozilla.fenix.GleanMetrics.VoiceSearch import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.components.toolbar.ToolbarPosition import org.mozilla.fenix.databinding.FragmentSearchDialogBinding import org.mozilla.fenix.databinding.SearchSuggestionsHintBinding @@ -163,8 +162,6 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler { val activity = requireActivity() as HomeActivity val isPrivate = activity.browsingModeManager.mode.isPrivate - requireComponents.analytics.metrics.track(Event.InteractWithSearchURLArea) - store = SearchDialogFragmentStore( createInitialSearchFragmentState( activity, diff --git a/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt index 0c5bacdeda..baa4421b33 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/deletebrowsingdata/DeleteBrowsingDataFragment.kt @@ -23,7 +23,6 @@ import mozilla.components.lib.state.ext.flowScoped import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged import org.mozilla.fenix.R import org.mozilla.fenix.components.FenixSnackbar -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.databinding.FragmentDeleteBrowsingDataBinding import org.mozilla.fenix.ext.requireComponents import org.mozilla.fenix.ext.settings @@ -163,7 +162,6 @@ class DeleteBrowsingDataFragment : Fragment(R.layout.fragment_delete_browsing_da withContext(Main) { finishDeletion() - requireComponents.analytics.metrics.track(Event.ClearedPrivateData) } } } diff --git a/app/src/main/java/org/mozilla/gecko/search/SearchWidgetProvider.kt b/app/src/main/java/org/mozilla/gecko/search/SearchWidgetProvider.kt index 8335445e0d..c02594f7ae 100644 --- a/app/src/main/java/org/mozilla/gecko/search/SearchWidgetProvider.kt +++ b/app/src/main/java/org/mozilla/gecko/search/SearchWidgetProvider.kt @@ -24,8 +24,6 @@ import androidx.core.graphics.drawable.toBitmap import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.IntentReceiverActivity import org.mozilla.fenix.R -import org.mozilla.fenix.components.metrics.Event -import org.mozilla.fenix.ext.metrics import org.mozilla.fenix.ext.settings import org.mozilla.fenix.home.intent.StartSearchIntentProcessor import org.mozilla.fenix.utils.IntentUtils @@ -40,7 +38,6 @@ class SearchWidgetProvider : AppWidgetProvider() { override fun onEnabled(context: Context) { context.settings().addSearchWidgetInstalled(1) - context.metrics.track(Event.SearchWidgetInstalled) } override fun onDeleted(context: Context, appWidgetIds: IntArray) { 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 e8f2227d0b..a4982a2f63 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 @@ -79,9 +79,6 @@ class MetricControllerTest { controller.stop(MetricServiceType.Data) verify { logger.debug("DebugMetricController: stop") } - - controller.track(Event.OpenedAppFirstRun) - verify { logger.debug("DebugMetricController: track event: ${Event.OpenedAppFirstRun}") } } @Test diff --git a/app/src/test/java/org/mozilla/fenix/onboarding/FenixOnboardingTest.kt b/app/src/test/java/org/mozilla/fenix/onboarding/FenixOnboardingTest.kt index 577e57ad71..55b16816ea 100644 --- a/app/src/test/java/org/mozilla/fenix/onboarding/FenixOnboardingTest.kt +++ b/app/src/test/java/org/mozilla/fenix/onboarding/FenixOnboardingTest.kt @@ -15,7 +15,6 @@ import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.components.metrics.MetricController import org.mozilla.fenix.ext.components import org.mozilla.fenix.helpers.FenixRobolectricTestRunner @@ -64,6 +63,5 @@ class FenixOnboardingTest { fun testFinish() { onboarding.finish() verify { preferencesEditor.putInt(LAST_VERSION_ONBOARDING_KEY, CURRENT_ONBOARDING_VERSION) } - verify { metrics.track(Event.DismissedOnboarding) } } }