From 093e70faad14199c1db777e822eb424bcfe251c6 Mon Sep 17 00:00:00 2001 From: mcarare <48995920+mcarare@users.noreply.github.com> Date: Thu, 16 Feb 2023 20:47:11 +0200 Subject: [PATCH] Bug 1796348 - Add notification delegate as a component in apps. This adds notification delegate as a component in Fenix, Focus and Sample Browser. --- .../java/org/mozilla/fenix/components/Components.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/components/Components.kt b/app/src/main/java/org/mozilla/fenix/components/Components.kt index f0d6aebc5d..89afedecab 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Components.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Components.kt @@ -9,6 +9,7 @@ import android.app.Application import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.ui.platform.LocalContext +import androidx.core.app.NotificationManagerCompat import com.google.android.play.core.review.ReviewManagerFactory import mozilla.components.feature.addons.AddonManager import mozilla.components.feature.addons.amo.AddonCollectionProvider @@ -16,6 +17,7 @@ import mozilla.components.feature.addons.migration.DefaultSupportedAddonsChecker import mozilla.components.feature.addons.update.DefaultAddonUpdater import mozilla.components.feature.autofill.AutofillConfiguration import mozilla.components.lib.publicsuffixlist.PublicSuffixList +import mozilla.components.support.base.android.NotificationsDelegate import mozilla.components.support.base.worker.Frequency import org.mozilla.fenix.BuildConfig import org.mozilla.fenix.Config @@ -88,6 +90,14 @@ class Components(private val context: Context) { ) } + private val notificationManagerCompat = NotificationManagerCompat.from(context) + + val notificationsDelegate: NotificationsDelegate by lazyMonitored { + NotificationsDelegate( + notificationManagerCompat, + ) + } + val intentProcessors by lazyMonitored { IntentProcessors( context,