Commit 2b1122bc authored by Sawyer Blatz's avatar Sawyer Blatz Committed by Emily Kager
Browse files

For #11531: Add search widget installed leanplum event

parent 6b6e1956
......@@ -665,6 +665,7 @@ private val Event.wrapper: EventWrapper<*>?
is Event.DismissedOnboarding -> null
is Event.FennecToFenixMigrated -> null
is Event.AddonInstalled -> null
is Event.SearchWidgetInstalled -> null
}
class GleanMetricsService(private val context: Context) : MetricsService {
......
......@@ -39,6 +39,7 @@ private val Event.name: String?
is Event.DismissedOnboarding -> "E_Dismissed_Onboarding"
is Event.FennecToFenixMigrated -> "E_Fennec_To_Fenix_Migrated"
is Event.AddonInstalled -> "E_Addon_Installed"
is Event.SearchWidgetInstalled -> "E_Search_Widget_Added"
// Do not track other events in Leanplum
else -> null
......
......@@ -176,6 +176,7 @@ sealed class Event {
object SearchWidgetCFRCanceled : Event()
object SearchWidgetCFRNotNowPressed : Event()
object SearchWidgetCFRAddWidgetPressed : Event()
object SearchWidgetInstalled : Event()
object OnboardingAutoSignIn : Event()
object OnboardingManualSignIn : Event()
object OnboardingPrivacyNotice : Event()
......
......@@ -23,6 +23,8 @@ import androidx.core.graphics.drawable.toBitmap
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.IntentReceiverActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.home.intent.StartSearchIntentProcessor
import org.mozilla.fenix.widget.VoiceSearchActivity
......@@ -36,6 +38,7 @@ class SearchWidgetProvider : AppWidgetProvider() {
override fun onEnabled(context: Context) {
context.settings().addSearchWidgetInstalled(1)
context.metrics.track(Event.SearchWidgetInstalled)
}
override fun onDeleted(context: Context, appWidgetIds: IntArray) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment