mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/24841: Remove unused events.
This commit is contained in:
parent
d585593ff1
commit
e604e555c5
@ -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(
|
||||
|
@ -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
|
||||
|
||||
|
@ -126,14 +126,6 @@ private val Event.wrapper: EventWrapper<*>?
|
||||
is Event.HistorySearchGroupOpened -> EventWrapper<NoExtraKeys>(
|
||||
{ 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
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 &&
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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) }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user