|
|
|
@ -68,6 +68,7 @@ import mozilla.components.support.locale.LocaleAwareAppCompatActivity
|
|
|
|
|
import mozilla.components.support.utils.SafeIntent
|
|
|
|
|
import mozilla.components.support.utils.toSafeIntent
|
|
|
|
|
import mozilla.components.support.webextensions.WebExtensionPopupFeature
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.Events
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.Metrics
|
|
|
|
|
import org.mozilla.fenix.addons.AddonDetailsFragmentDirections
|
|
|
|
|
import org.mozilla.fenix.addons.AddonPermissionsDetailsFragmentDirections
|
|
|
|
@ -258,7 +259,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
|
|
|
|
val safeIntent = intent?.toSafeIntent()
|
|
|
|
|
safeIntent
|
|
|
|
|
?.let(::getIntentSource)
|
|
|
|
|
?.also { components.analytics.metrics.track(Event.OpenedApp(it)) }
|
|
|
|
|
?.also { Events.appOpened.record(Events.AppOpenedExtra(it)) }
|
|
|
|
|
}
|
|
|
|
|
supportActionBar?.hide()
|
|
|
|
|
|
|
|
|
@ -667,10 +668,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@VisibleForTesting(otherwise = PROTECTED)
|
|
|
|
|
internal open fun getIntentSource(intent: SafeIntent): Event.OpenedApp.Source? {
|
|
|
|
|
internal open fun getIntentSource(intent: SafeIntent): String? {
|
|
|
|
|
return when {
|
|
|
|
|
intent.isLauncherIntent -> Event.OpenedApp.Source.APP_ICON
|
|
|
|
|
intent.action == Intent.ACTION_VIEW -> Event.OpenedApp.Source.LINK
|
|
|
|
|
intent.isLauncherIntent -> "APP_ICON"
|
|
|
|
|
intent.action == Intent.ACTION_VIEW -> "LINK"
|
|
|
|
|
else -> null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|