Skip to content

Commit

Permalink
For mozilla-mobile#11656 - Adds addon user attributes to leanplum
Browse files Browse the repository at this point in the history
  • Loading branch information
boek committed Aug 13, 2020
1 parent 4542b4b commit 4fce6ec
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.mozilla.fenix.components.metrics

import androidx.annotation.VisibleForTesting
import com.leanplum.Leanplum
import mozilla.components.browser.awesomebar.facts.BrowserAwesomeBarFacts
import mozilla.components.browser.menu.facts.BrowserMenuFacts
import mozilla.components.browser.toolbar.facts.ToolbarFacts
Expand Down Expand Up @@ -193,13 +194,15 @@ internal class ReleaseMetricController(
if (installedAddons is List<*>) {
Addons.installedAddons.set(installedAddons.map { it.toString() })
Addons.hasInstalledAddons.set(installedAddons.size > 0)
Leanplum.setUserAttributes(mapOf("installed_addons" to installedAddons.size))
}
}

metadata?.get("enabled")?.let { enabledAddons ->
if (enabledAddons is List<*>) {
Addons.enabledAddons.set(enabledAddons.map { it.toString() })
Addons.hasEnabledAddons.set(enabledAddons.size > 0)
Leanplum.setUserAttributes(mapOf("enabled_addons" to enabledAddons.size))
}
}

Expand Down

0 comments on commit 4fce6ec

Please sign in to comment.