For #26191 - Add telemetry for jump back in onboarding message

This commit is contained in:
Alexandru2909 2022-07-26 16:12:30 +03:00 committed by mergify[bot]
parent b432436859
commit 03bc209dfd
2 changed files with 47 additions and 0 deletions

View File

@ -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:

View File

@ -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()
}