|
|
@ -37,7 +37,8 @@ private val Event.name: String?
|
|
|
|
is Event.CollectionSaved -> "E_Collection_Created"
|
|
|
|
is Event.CollectionSaved -> "E_Collection_Created"
|
|
|
|
is Event.CollectionTabRestored -> "E_Collection_Tab_Opened"
|
|
|
|
is Event.CollectionTabRestored -> "E_Collection_Tab_Opened"
|
|
|
|
is Event.SyncAuthSignUp -> "E_FxA_New_Signup"
|
|
|
|
is Event.SyncAuthSignUp -> "E_FxA_New_Signup"
|
|
|
|
is Event.SyncAuthSignIn -> "E_Sign_In_FxA"
|
|
|
|
is Event.SyncAuthSignIn, Event.SyncAuthPaired, Event.SyncAuthOtherExternal -> "E_Sign_In_FxA"
|
|
|
|
|
|
|
|
is Event.SyncAuthFromShared -> "E_Sign_In_FxA_Fennec_to_Fenix"
|
|
|
|
is Event.SyncAuthSignOut -> "E_Sign_Out_FxA"
|
|
|
|
is Event.SyncAuthSignOut -> "E_Sign_Out_FxA"
|
|
|
|
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"
|
|
|
@ -142,8 +143,10 @@ class LeanplumMetricsService(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Leanplum.start(application, hashMapOf(
|
|
|
|
Leanplum.start(
|
|
|
|
"default_browser" to MozillaProductDetector.getMozillaBrowserDefault(application).orEmpty(),
|
|
|
|
application, hashMapOf(
|
|
|
|
|
|
|
|
"default_browser" to MozillaProductDetector.getMozillaBrowserDefault(application)
|
|
|
|
|
|
|
|
.orEmpty(),
|
|
|
|
"fennec_installed" to installedApps.contains(MozillaProducts.FIREFOX.productName),
|
|
|
|
"fennec_installed" to installedApps.contains(MozillaProducts.FIREFOX.productName),
|
|
|
|
"focus_installed" to installedApps.contains(MozillaProducts.FOCUS.productName),
|
|
|
|
"focus_installed" to installedApps.contains(MozillaProducts.FOCUS.productName),
|
|
|
|
"klar_installed" to installedApps.contains(MozillaProducts.KLAR.productName),
|
|
|
|
"klar_installed" to installedApps.contains(MozillaProducts.KLAR.productName),
|
|
|
@ -153,7 +156,8 @@ class LeanplumMetricsService(
|
|
|
|
"tracking_protection_enabled" to application.settings().shouldUseTrackingProtection,
|
|
|
|
"tracking_protection_enabled" to application.settings().shouldUseTrackingProtection,
|
|
|
|
"tracking_protection_setting" to trackingProtection,
|
|
|
|
"tracking_protection_setting" to trackingProtection,
|
|
|
|
"fenix" to true
|
|
|
|
"fenix" to true
|
|
|
|
))
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
withContext(Main) {
|
|
|
|
withContext(Main) {
|
|
|
|
LeanplumInternal.setCalledStart(true)
|
|
|
|
LeanplumInternal.setCalledStart(true)
|
|
|
@ -202,7 +206,9 @@ class LeanplumMetricsService(
|
|
|
|
get() =
|
|
|
|
get() =
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.isO3Language
|
|
|
|
this.isO3Language
|
|
|
|
} catch (_: MissingResourceException) { null }
|
|
|
|
} catch (_: MissingResourceException) {
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
companion object {
|
|
|
|
private const val LOGTAG = "LeanplumMetricsService"
|
|
|
|
private const val LOGTAG = "LeanplumMetricsService"
|
|
|
@ -213,6 +219,7 @@ class LeanplumMetricsService(
|
|
|
|
private val LeanplumToken: String
|
|
|
|
private val LeanplumToken: String
|
|
|
|
// Debug builds have a null (nullable) LEANPLUM_TOKEN
|
|
|
|
// Debug builds have a null (nullable) LEANPLUM_TOKEN
|
|
|
|
get() = BuildConfig.LEANPLUM_TOKEN.orEmpty()
|
|
|
|
get() = BuildConfig.LEANPLUM_TOKEN.orEmpty()
|
|
|
|
|
|
|
|
|
|
|
|
// Leanplum needs to be enabled for the following locales.
|
|
|
|
// Leanplum needs to be enabled for the following locales.
|
|
|
|
// Irrespective of the actual device location.
|
|
|
|
// Irrespective of the actual device location.
|
|
|
|
private val LEANPLUM_ENABLED_LOCALES = setOf(
|
|
|
|
private val LEANPLUM_ENABLED_LOCALES = setOf(
|
|
|
|