Commit 8cd2a91a authored by Roger Yang's avatar Roger Yang Committed by royang@mozilla.com
Browse files

Bug 1967798 - Add telemetry for custom search engine creation. r=android-reviewers,skhan,tchoh

parent 53fd00cc
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -886,6 +886,36 @@ events:
    metadata:
      tags:
        - Search
  custom_engine_settings_viewed:
    type: event
    description: |
      A user viewed the custom search engine setting
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1967798
    data_reviews:
      - https://phabricator.services.mozilla.com/D250487
    notification_emails:
      - android-probes@mozilla.com
    expires: never
    metadata:
      tags:
        - Search
        - Settings
  custom_engine_created:
    type: event
    description: |
      A user created a new custom search engine to use
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1967798
    data_reviews:
      - https://phabricator.services.mozilla.com/D250487
    notification_emails:
      - android-probes@mozilla.com
    expires: never
    metadata:
      tags:
        - Search
        - Settings
  first_session_ping_cancelled:
    type: event
    description: |
+6 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import kotlinx.coroutines.launch
import mozilla.components.browser.icons.IconRequest
import mozilla.components.feature.search.ext.createSearchEngine
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.GleanMetrics.Events
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.compose.snackbar.Snackbar
@@ -62,12 +63,16 @@ class SaveSearchEngineFragment : Fragment(R.layout.fragment_save_search_engine)

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        Events.customEngineSettingsViewed.record()

        _binding = FragmentSaveSearchEngineBinding.bind(view)

        binding.saveButton.apply {
            isEnabled = false
            setOnClickListener { createCustomEngine() }
            setOnClickListener {
                createCustomEngine()
                Events.customEngineCreated.record()
            }
        }

        binding.editEngineName.addTextChangedListener(inputListener)