* For #11655: add leanplum event for installing an addon * Add link to data-review request in PR * Addressed CI commentsmaster
parent
31248b835c
commit
9df13ae121
|
@ -29,8 +29,10 @@ import mozilla.components.feature.addons.ui.AddonsManagerAdapterDelegate
|
||||||
import mozilla.components.feature.addons.ui.PermissionsDialogFragment
|
import mozilla.components.feature.addons.ui.PermissionsDialogFragment
|
||||||
import mozilla.components.feature.addons.ui.translatedName
|
import mozilla.components.feature.addons.ui.translatedName
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
|
import org.mozilla.fenix.components.metrics.Event
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.ext.getRootView
|
import org.mozilla.fenix.ext.getRootView
|
||||||
|
import org.mozilla.fenix.ext.requireComponents
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.ext.showToolbar
|
import org.mozilla.fenix.ext.showToolbar
|
||||||
import org.mozilla.fenix.theme.ThemeManager
|
import org.mozilla.fenix.theme.ThemeManager
|
||||||
|
@ -192,11 +194,13 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management),
|
||||||
onPositiveButtonClicked = onPositiveButtonClicked
|
onPositiveButtonClicked = onPositiveButtonClicked
|
||||||
)
|
)
|
||||||
dialog.show(parentFragmentManager, PERMISSIONS_DIALOG_FRAGMENT_TAG)
|
dialog.show(parentFragmentManager, PERMISSIONS_DIALOG_FRAGMENT_TAG)
|
||||||
|
requireContext().components.analytics.metrics.track(Event.AddonInstalled(addon.id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showInstallationDialog(addon: Addon) {
|
private fun showInstallationDialog(addon: Addon) {
|
||||||
if (!isInstallationInProgress && !hasExistingAddonInstallationDialogFragment()) {
|
if (!isInstallationInProgress && !hasExistingAddonInstallationDialogFragment()) {
|
||||||
|
requireComponents.analytics.metrics.track(Event.AddonInstalled(addon.id))
|
||||||
val addonCollectionProvider = requireContext().components.addonCollectionProvider
|
val addonCollectionProvider = requireContext().components.addonCollectionProvider
|
||||||
|
|
||||||
val dialog = AddonInstallationDialogFragment.newInstance(
|
val dialog = AddonInstallationDialogFragment.newInstance(
|
||||||
|
|
|
@ -650,6 +650,7 @@ private val Event.wrapper: EventWrapper<*>?
|
||||||
is Event.ClearedPrivateData -> null
|
is Event.ClearedPrivateData -> null
|
||||||
is Event.DismissedOnboarding -> null
|
is Event.DismissedOnboarding -> null
|
||||||
is Event.FennecToFenixMigrated -> null
|
is Event.FennecToFenixMigrated -> null
|
||||||
|
is Event.AddonInstalled -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
class GleanMetricsService(private val context: Context) : MetricsService {
|
class GleanMetricsService(private val context: Context) : MetricsService {
|
||||||
|
|
|
@ -38,9 +38,10 @@ private val Event.name: String?
|
||||||
is Event.ClearedPrivateData -> "E_Cleared_Private_Data"
|
is Event.ClearedPrivateData -> "E_Cleared_Private_Data"
|
||||||
is Event.DismissedOnboarding -> "E_Dismissed_Onboarding"
|
is Event.DismissedOnboarding -> "E_Dismissed_Onboarding"
|
||||||
is Event.FennecToFenixMigrated -> "E_Fennec_To_Fenix_Migrated"
|
is Event.FennecToFenixMigrated -> "E_Fennec_To_Fenix_Migrated"
|
||||||
|
is Event.AddonInstalled -> "E_Addon_Installed"
|
||||||
|
|
||||||
// Do not track other events in Leanplum
|
// Do not track other events in Leanplum
|
||||||
else -> ""
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
class LeanplumMetricsService(private val application: Application) : MetricsService {
|
class LeanplumMetricsService(private val application: Application) : MetricsService {
|
||||||
|
|
|
@ -465,6 +465,8 @@ sealed class Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
object CrashReporterOpened : Event()
|
object CrashReporterOpened : Event()
|
||||||
|
data class AddonInstalled(val addonId: String) : Event()
|
||||||
|
|
||||||
data class CrashReporterClosed(val crashSubmitted: Boolean) : Event() {
|
data class CrashReporterClosed(val crashSubmitted: Boolean) : Event() {
|
||||||
override val extras: Map<CrashReporter.closedKeys, String>?
|
override val extras: Map<CrashReporter.closedKeys, String>?
|
||||||
get() = mapOf(CrashReporter.closedKeys.crashSubmitted to crashSubmitted.toString())
|
get() = mapOf(CrashReporter.closedKeys.crashSubmitted to crashSubmitted.toString())
|
||||||
|
|
|
@ -231,6 +231,11 @@ Here is the list of current Events sent, which can be found here in the code bas
|
||||||
<td>The user has just migrated from Fennec to Fenix.</td>
|
<td>The user has just migrated from Fennec to Fenix.</td>
|
||||||
<td><a href="https://github.com/mozilla-mobile/fenix/pull/8208#issuecomment-584040440">#8208</a></td>
|
<td><a href="https://github.com/mozilla-mobile/fenix/pull/8208#issuecomment-584040440">#8208</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>`E_Addon_Installed`</td>
|
||||||
|
<td>The user has installed an addon from the addon management page.</td>
|
||||||
|
<td><a href="https://github.com/mozilla-mobile/fenix/pull/12136#issuecomment-651922547">#12136</a></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Deep links
|
Deep links
|
||||||
|
|
Loading…
Reference in New Issue