Unverified Commit a40efbea authored by Roger Yang's avatar Roger Yang Committed by GitHub
Browse files

Closes #19847: Add telemetry for the default browser notification (#20396)

parent 10485212
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -178,6 +178,19 @@ events:
    notification_emails:
      - android-probes@mozilla.com
    expires: "2021-10-01"
  default_browser_notif_tapped:
    type: event
    description: |
      User tapped on the default browser notification
    bugs:
      - https://github.com/mozilla-mobile/fenix/issues/19847
    data_reviews:
      - https://github.com/mozilla-mobile/fenix/pull/20311
    data_sensitivity:
      - interaction
    notification_emails:
      - android-probes@mozilla.com
    expires: "2022-08-01"
  toolbar_menu_visible:
    type: event
    description: |
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
            StartSearchIntentProcessor(components.analytics.metrics),
            OpenBrowserIntentProcessor(this, ::getIntentSessionId),
            OpenSpecificTabIntentProcessor(this),
            DefaultBrowserIntentProcessor(this)
            DefaultBrowserIntentProcessor(this, components.analytics.metrics)
        )
    }

+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ sealed class Event {
    object OnboardingPrivateBrowsing : Event()
    object OnboardingFinish : Event()
    object ChangedToDefaultBrowser : Event()
    object DefaultBrowserNotifTapped : Event()

    object LoginDialogPromptDisplayed : Event()
    object LoginDialogPromptCancelled : Event()
+3 −0
Original line number Diff line number Diff line
@@ -197,6 +197,9 @@ private val Event.wrapper: EventWrapper<*>?
        is Event.ChangedToDefaultBrowser -> EventWrapper<NoExtraKeys>(
            { Events.defaultBrowserChanged.record(it) }
        )
        is Event.DefaultBrowserNotifTapped -> EventWrapper<NoExtraKeys>(
            { Events.defaultBrowserNotifTapped.record(it) }
        )
        is Event.OpenedBookmark -> EventWrapper<NoExtraKeys>(
            { BookmarksManagement.open.record(it) }
        )
+5 −2
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ package org.mozilla.fenix.home.intent
import android.content.Intent
import androidx.navigation.NavController
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.ext.openSetDefaultBrowserOption
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.onboarding.DefaultBrowserNotificationWorker.Companion.isDefaultBrowserNotificationIntent
@@ -18,13 +20,14 @@ import org.mozilla.fenix.onboarding.DefaultBrowserNotificationWorker.Companion.i
 * notification, [settings.shouldShowDefaultBrowserNotification] will return false
 */
class DefaultBrowserIntentProcessor(
    private val activity: HomeActivity
    private val activity: HomeActivity,
    private val metrics: MetricController
) : HomeIntentProcessor {

    override fun process(intent: Intent, navController: NavController, out: Intent): Boolean {
        return if (isDefaultBrowserNotificationIntent(intent)) {
            activity.openSetDefaultBrowserOption()

            metrics.track(Event.DefaultBrowserNotifTapped)
            true
        } else {
            false
Loading