diff --git a/app/metrics.yaml b/app/metrics.yaml index 2fee91ff9..c39544eb5 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -7508,6 +7508,45 @@ recent_tabs: notification_emails: - android-probes@mozilla.com expires: 107 + jump_back_in_cfr_shown: + type: event + description: | + Jump back in CFR has been displayed to the user. + bugs: + - https://github.com/mozilla-mobile/fenix/issues/26191 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/26202 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: 119 + jump_back_in_cfr_dismissed: + type: event + description: | + Jump back in CFR has been dismissed clicking the X button. + bugs: + - https://github.com/mozilla-mobile/fenix/issues/26191 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/26202 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: 119 + jump_back_in_cfr_cancelled: + type: event + description: | + Jump back in CFR has been cancelled clicking the outside the CFR. + bugs: + - https://github.com/mozilla-mobile/fenix/issues/26191 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/26202 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: 119 recent_bookmarks: shown: diff --git a/app/src/main/java/org/mozilla/fenix/onboarding/JumpBackInCFRDialog.kt b/app/src/main/java/org/mozilla/fenix/onboarding/JumpBackInCFRDialog.kt index f362c81a7..1cc239663 100644 --- a/app/src/main/java/org/mozilla/fenix/onboarding/JumpBackInCFRDialog.kt +++ b/app/src/main/java/org/mozilla/fenix/onboarding/JumpBackInCFRDialog.kt @@ -12,6 +12,8 @@ import android.view.Gravity import android.view.LayoutInflater import android.view.View import androidx.recyclerview.widget.RecyclerView +import mozilla.telemetry.glean.private.NoExtras +import org.mozilla.fenix.GleanMetrics.RecentTabs import org.mozilla.fenix.databinding.OnboardingJumpBackInCfrBinding import org.mozilla.fenix.ext.settings import org.mozilla.fenix.home.recentsyncedtabs.view.RecentSyncedTabViewHolder @@ -30,6 +32,8 @@ class JumpBackInCFRDialog(val recyclerView: RecyclerView) { jumpBackInView?.let { val crfDialog = createJumpCRF(anchor = jumpBackInView) crfDialog?.let { + RecentTabs.jumpBackInCfrShown.record(NoExtras()) + val context = jumpBackInView.context context.settings().shouldShowJumpBackInCFR = false it.show() @@ -80,10 +84,14 @@ class JumpBackInCFRDialog(val recyclerView: RecyclerView) { popup.apply { setContentView(popupBinding.root) setCanceledOnTouchOutside(true) + setOnCancelListener { + RecentTabs.jumpBackInCfrCancelled.record(NoExtras()) + } // removing title or setting it as an empty string does not prevent a11y services from assigning one setTitle(" ") } popupBinding.closeInfoBanner.setOnClickListener { + RecentTabs.jumpBackInCfrDismissed.record(NoExtras()) popup.dismiss() }