summaryrefslogtreecommitdiffstats
path: root/mobile/android/android-components/components/feature/webnotifications
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /mobile/android/android-components/components/feature/webnotifications
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/android-components/components/feature/webnotifications')
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/README.md19
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/build.gradle46
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/proguard-rules.pro21
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/AndroidManifest.xml4
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/NativeNotificationBridge.kt107
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationFeature.kt122
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessor.kt36
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-am/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-an/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ar/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ast/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-az/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-azb/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ban/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-be/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bg/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bn/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-br/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bs/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ca/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cak/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ceb/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ckb/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-co/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cs/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cy/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-da/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-de/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-dsb/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-el/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rCA/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rGB/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eo/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rAR/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rCL/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rES/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rMX/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-et/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eu/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fa/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ff/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fi/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fur/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fy-rNL/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gd/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gl/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gn/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gu-rIN/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hi-rIN/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hsb/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hu/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hy-rAM/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ia/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-in/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-is/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-it/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-iw/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ja/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ka/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kaa/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kab/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kk/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kmr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kn/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ko/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lo/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lt/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-mr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-my/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nb-rNO/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ne-rNP/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nl/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nn-rNO/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-oc/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rIN/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rPK/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pl/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rBR/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rPT/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-rm/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ro/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ru/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sat/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sc/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-si/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sk/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-skr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sl/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sq/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-su/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sv-rSE/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ta/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-te/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tg/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-th/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tl/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tok/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tr/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-trs/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tt/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tzm/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ug/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uk/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ur/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uz/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-vi/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-yo/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rCN/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rTW/strings.xml5
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/main/res/values/strings.xml8
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/NativeNotificationBridgeTest.kt140
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationFeatureTest.kt220
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessorTest.kt51
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker2
-rw-r--r--mobile/android/android-components/components/feature/webnotifications/src/test/resources/robolectric.properties1
119 files changed, 1307 insertions, 0 deletions
diff --git a/mobile/android/android-components/components/feature/webnotifications/README.md b/mobile/android/android-components/components/feature/webnotifications/README.md
new file mode 100644
index 0000000000..1bc66d5ae2
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/README.md
@@ -0,0 +1,19 @@
+# [Android Components](../../../README.md) > Feature > Web Notifications
+
+A component for displaying web notifications.
+
+## Usage
+
+### Setting up the dependency
+
+Use Gradle to download the library from [maven.mozilla.org](https://maven.mozilla.org/) ([Setup repository](../../../README.md#maven-repository)):
+
+```Groovy
+implementation "org.mozilla.components:feature-webnotifications:{latest-version}"
+```
+
+## License
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/
diff --git a/mobile/android/android-components/components/feature/webnotifications/build.gradle b/mobile/android/android-components/components/feature/webnotifications/build.gradle
new file mode 100644
index 0000000000..c9a1abf2c6
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/build.gradle
@@ -0,0 +1,46 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+
+android {
+ defaultConfig {
+ minSdkVersion config.minSdkVersion
+ compileSdk config.compileSdkVersion
+ targetSdkVersion config.targetSdkVersion
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ namespace 'mozilla.components.feature.webnotifications'
+}
+
+dependencies {
+ implementation project(':browser-icons')
+ implementation project(':concept-engine')
+ implementation project(':feature-sitepermissions')
+ implementation project(':feature-intent')
+ implementation project(':support-ktx')
+ implementation project(':support-utils')
+
+ implementation ComponentsDependencies.androidx_core_ktx
+ implementation ComponentsDependencies.kotlin_coroutines
+
+ testImplementation project(':support-test')
+
+ testImplementation ComponentsDependencies.androidx_test_core
+ testImplementation ComponentsDependencies.androidx_test_junit
+ testImplementation ComponentsDependencies.testing_coroutines
+ testImplementation ComponentsDependencies.testing_robolectric
+}
+
+apply from: '../../../android-lint.gradle'
+apply from: '../../../publish.gradle'
+ext.configurePublish(config.componentsGroupId, archivesBaseName, project.ext.description)
diff --git a/mobile/android/android-components/components/feature/webnotifications/proguard-rules.pro b/mobile/android/android-components/components/feature/webnotifications/proguard-rules.pro
new file mode 100644
index 0000000000..f1b424510d
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/AndroidManifest.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..e16cda1d34
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/AndroidManifest.xml
@@ -0,0 +1,4 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<manifest />
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/NativeNotificationBridge.kt b/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/NativeNotificationBridge.kt
new file mode 100644
index 0000000000..f195bb2859
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/NativeNotificationBridge.kt
@@ -0,0 +1,107 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package mozilla.components.feature.webnotifications
+
+import android.app.Activity
+import android.app.Notification
+import android.app.PendingIntent
+import android.content.Context
+import android.content.Intent
+import android.graphics.Bitmap
+import android.os.Build
+import android.os.Build.VERSION.SDK_INT
+import androidx.annotation.DrawableRes
+import androidx.core.app.NotificationCompat
+import mozilla.components.browser.icons.BrowserIcons
+import mozilla.components.browser.icons.Icon.Source
+import mozilla.components.browser.icons.IconRequest
+import mozilla.components.browser.icons.IconRequest.Size
+import mozilla.components.concept.engine.webnotifications.WebNotification
+import mozilla.components.support.ktx.kotlin.tryGetHostFromUrl
+import mozilla.components.support.utils.PendingIntentUtils
+
+internal class NativeNotificationBridge(
+ private val icons: BrowserIcons,
+ @DrawableRes private val smallIcon: Int,
+) {
+ companion object {
+ internal const val EXTRA_ON_CLICK = "mozac.feature.webnotifications.generic.onclick"
+ }
+
+ /**
+ * Create a system [Notification] from this [WebNotification].
+ */
+ suspend fun convertToAndroidNotification(
+ notification: WebNotification,
+ context: Context,
+ channelId: String,
+ activityClass: Class<out Activity>?,
+ requestId: Int,
+ ): Notification {
+ val builder = if (SDK_INT >= Build.VERSION_CODES.O) {
+ NotificationCompat.Builder(context, channelId)
+ } else {
+ @Suppress("Deprecation")
+ NotificationCompat.Builder(context)
+ }
+
+ with(notification) {
+ activityClass?.let {
+ val intent = Intent(context, activityClass).apply {
+ putExtra(EXTRA_ON_CLICK, notification.engineNotification)
+ }
+
+ PendingIntent.getActivity(context, requestId, intent, PendingIntentUtils.defaultFlags).apply {
+ builder.setContentIntent(this)
+ }
+ }
+
+ builder.setSmallIcon(smallIcon)
+ .setContentTitle(title)
+ .setShowWhen(true)
+ .setWhen(timestamp)
+ .setAutoCancel(true)
+ .setSilent(notification.silent)
+
+ sourceUrl?.let {
+ builder.setSubText(it.tryGetHostFromUrl())
+ }
+
+ body?.let {
+ builder.setContentText(body)
+ .setStyle(NotificationCompat.BigTextStyle().bigText(body))
+ }
+
+ loadIcon(sourceUrl, iconUrl, Size.DEFAULT, true)?.let { iconBitmap ->
+ builder.setLargeIcon(iconBitmap)
+ }
+ }
+
+ return builder.build()
+ }
+
+ /**
+ * Load an icon for a notification.
+ */
+ private suspend fun loadIcon(url: String?, iconUrl: String?, size: Size, isPrivate: Boolean): Bitmap? {
+ url ?: return null
+ iconUrl ?: return null
+ val icon = icons.loadIcon(
+ IconRequest(
+ url = url,
+ size = size,
+ resources = listOf(
+ IconRequest.Resource(
+ url = iconUrl,
+ type = IconRequest.Resource.Type.MANIFEST_ICON,
+ ),
+ ),
+ isPrivate = isPrivate,
+ ),
+ ).await()
+
+ return if (icon.source == Source.GENERATOR) null else icon.bitmap
+ }
+}
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationFeature.kt b/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationFeature.kt
new file mode 100644
index 0000000000..62ace5b5ef
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationFeature.kt
@@ -0,0 +1,122 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package mozilla.components.feature.webnotifications
+
+import android.app.Activity
+import android.app.NotificationChannel
+import android.app.NotificationManager
+import android.content.Context
+import android.os.Build
+import androidx.annotation.DrawableRes
+import androidx.core.app.NotificationCompat
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import mozilla.components.browser.icons.BrowserIcons
+import mozilla.components.concept.engine.Engine
+import mozilla.components.concept.engine.permission.SitePermissionsStorage
+import mozilla.components.concept.engine.webnotifications.WebNotification
+import mozilla.components.concept.engine.webnotifications.WebNotificationDelegate
+import mozilla.components.support.base.android.NotificationsDelegate
+import mozilla.components.support.base.ids.SharedIdsHelper
+import mozilla.components.support.base.log.logger.Logger
+import mozilla.components.support.ktx.kotlin.getOrigin
+import java.lang.UnsupportedOperationException
+import kotlin.coroutines.CoroutineContext
+
+private const val NOTIFICATION_CHANNEL_ID = "mozac.feature.webnotifications.generic.channel"
+private const val PENDING_INTENT_TAG = "mozac.feature.webnotifications.generic.pendingintent"
+internal const val NOTIFICATION_ID = 1
+
+/**
+ * Feature implementation for configuring and displaying web notifications to the user.
+ *
+ * Initialize this feature globally once on app start
+ * ```Kotlin
+ * WebNotificationFeature(
+ * applicationContext, engine, icons, R.mipmap.ic_launcher, sitePermissionsStorage, BrowserActivity::class.java
+ * )
+ * ```
+ *
+ * @param context The application Context.
+ * @param engine The browser engine.
+ * @param browserIcons The entry point for loading the large icon for the notification.
+ * @param smallIcon The small icon for the notification.
+ * @param sitePermissionsStorage The storage for checking notification site permissions.
+ * @param activityClass The Activity that the notification will launch if user taps on it
+ * @param coroutineContext An instance of [CoroutineContext] used for executing async site permission checks.
+ */
+@Suppress("LongParameterList")
+class WebNotificationFeature(
+ private val context: Context,
+ private val engine: Engine,
+ browserIcons: BrowserIcons,
+ @DrawableRes smallIcon: Int,
+ private val sitePermissionsStorage: SitePermissionsStorage,
+ private val activityClass: Class<out Activity>?,
+ private val coroutineContext: CoroutineContext = Dispatchers.IO,
+ private val notificationsDelegate: NotificationsDelegate,
+) : WebNotificationDelegate {
+ private val logger = Logger("WebNotificationFeature")
+ private val nativeNotificationBridge = NativeNotificationBridge(browserIcons, smallIcon)
+
+ init {
+ try {
+ engine.registerWebNotificationDelegate(this)
+ } catch (e: UnsupportedOperationException) {
+ logger.error("failed to register for web notification delegate", e)
+ }
+ }
+
+ override fun onShowNotification(webNotification: WebNotification) {
+ CoroutineScope(coroutineContext).launch {
+ // Only need to check permissions for notifications from web pages. Permissions for
+ // web extensions are managed via the extension's manifest and approved by the user
+ // upon installation.
+ if (!webNotification.triggeredByWebExtension) {
+ val origin = webNotification.sourceUrl?.getOrigin() ?: return@launch
+ val permissions = sitePermissionsStorage.findSitePermissionsBy(
+ origin,
+ private = webNotification.privateBrowsing,
+ )
+ ?: return@launch
+
+ if (!permissions.notification.isAllowed()) {
+ return@launch
+ }
+ }
+
+ ensureNotificationGroupAndChannelExists()
+ notificationsDelegate.notificationManagerCompat.cancel(webNotification.tag, NOTIFICATION_ID)
+
+ val notification = nativeNotificationBridge.convertToAndroidNotification(
+ webNotification,
+ context,
+ NOTIFICATION_CHANNEL_ID,
+ activityClass,
+ SharedIdsHelper.getNextIdForTag(context, PENDING_INTENT_TAG),
+ )
+ notificationsDelegate.notify(webNotification.tag, NOTIFICATION_ID, notification)
+ }
+ }
+
+ override fun onCloseNotification(webNotification: WebNotification) {
+ notificationsDelegate.notificationManagerCompat.cancel(webNotification.tag, NOTIFICATION_ID)
+ }
+
+ private fun ensureNotificationGroupAndChannelExists() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ val channel = NotificationChannel(
+ NOTIFICATION_CHANNEL_ID,
+ context.getString(R.string.mozac_feature_notification_channel_name),
+ NotificationManager.IMPORTANCE_DEFAULT,
+ )
+ channel.setShowBadge(true)
+ channel.lockscreenVisibility = NotificationCompat.VISIBILITY_PRIVATE
+
+ notificationsDelegate.notificationManagerCompat.createNotificationChannel(channel)
+ }
+ }
+}
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessor.kt b/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessor.kt
new file mode 100644
index 0000000000..0a961ccba7
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessor.kt
@@ -0,0 +1,36 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package mozilla.components.feature.webnotifications
+
+import android.content.Intent
+import android.os.Parcelable
+import mozilla.components.concept.engine.Engine
+import mozilla.components.feature.intent.processing.IntentProcessor
+import mozilla.components.support.utils.ext.getParcelableCompat
+
+/**
+ * Intent processor that tries matching a web notification and delegating a click interaction with it.
+ */
+class WebNotificationIntentProcessor(
+ private val engine: Engine,
+) : IntentProcessor {
+ /**
+ * Processes an incoming intent expected to contain information about a web notification.
+ * If such information is available this will inform the web notification about it being clicked.
+ */
+ override fun process(intent: Intent): Boolean {
+ @Suppress("MoveVariableDeclarationIntoWhen")
+ val engineNotification =
+ intent.extras?.getParcelableCompat(NativeNotificationBridge.EXTRA_ON_CLICK, Parcelable::class.java)
+
+ return when (engineNotification) {
+ null -> false
+ else -> {
+ engine.handleWebNotificationClick(engineNotification)
+ true
+ }
+ }
+ }
+}
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-am/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-am/strings.xml
new file mode 100644
index 0000000000..30a71e587e
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-am/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">የድረ-ገፅ ማሳወቂያዎች</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-an/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-an/strings.xml
new file mode 100644
index 0000000000..eb6b90cd0f
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-an/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificacions d\'o puesto</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ar/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ar/strings.xml
new file mode 100644
index 0000000000..19e6f3eb4e
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ar/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">تنبيهات الموقع</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ast/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ast/strings.xml
new file mode 100644
index 0000000000..95ba78ccd2
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ast/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Avisos de sitios</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-az/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-az/strings.xml
new file mode 100644
index 0000000000..db28cad1f5
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-az/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Sayt bildirişləri</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-azb/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-azb/strings.xml
new file mode 100644
index 0000000000..42ea59b477
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-azb/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">سایت بیلدیریش‌لری</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ban/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ban/strings.xml
new file mode 100644
index 0000000000..14e7c781d4
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ban/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Pakeling situs</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-be/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-be/strings.xml
new file mode 100644
index 0000000000..a351d36d46
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-be/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Абвесткі сайта</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bg/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bg/strings.xml
new file mode 100644
index 0000000000..a4d969da6c
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bg/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Известия от страници</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bn/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bn/strings.xml
new file mode 100644
index 0000000000..d96a8cc9ad
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bn/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">সাইট নোটিফিকেশন</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-br/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-br/strings.xml
new file mode 100644
index 0000000000..ffb34ac823
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-br/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Rebuzadurioù al lec’hienn</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bs/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bs/strings.xml
new file mode 100644
index 0000000000..8b1c110865
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-bs/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Obavještenja stranice</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ca/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ca/strings.xml
new file mode 100644
index 0000000000..3a0031aa4a
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ca/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificacions del lloc</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cak/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cak/strings.xml
new file mode 100644
index 0000000000..29320a3c87
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cak/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Taq rutzijol ruxaq</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ceb/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ceb/strings.xml
new file mode 100644
index 0000000000..9fc8907220
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ceb/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Pahibalo gikan sa site</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ckb/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ckb/strings.xml
new file mode 100644
index 0000000000..1d6691c4aa
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ckb/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">ئاگانامەکانی ماڵپەڕ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-co/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-co/strings.xml
new file mode 100644
index 0000000000..7a7e87e240
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-co/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Nutificazioni di situ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cs/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cs/strings.xml
new file mode 100644
index 0000000000..245c3a1bb2
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cs/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Oznámení z webových stránek</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cy/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cy/strings.xml
new file mode 100644
index 0000000000..372503cdb2
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-cy/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Hysbysiadau gwefannau</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-da/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-da/strings.xml
new file mode 100644
index 0000000000..052b5c4617
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-da/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Webstedsmeddelelser</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-de/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-de/strings.xml
new file mode 100644
index 0000000000..ba583d7b1e
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-de/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Website-Benachrichtigungen</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-dsb/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-dsb/strings.xml
new file mode 100644
index 0000000000..1a82c9b781
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-dsb/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Sedłowe powěźeńki</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-el/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-el/strings.xml
new file mode 100644
index 0000000000..ca7d493745
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-el/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Ειδοποιήσεις ιστοτόπου</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rCA/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000000..7170506170
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rCA/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Site notifications</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rGB/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rGB/strings.xml
new file mode 100644
index 0000000000..7170506170
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-en-rGB/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Site notifications</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eo/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eo/strings.xml
new file mode 100644
index 0000000000..e9ef8f1c98
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eo/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Retejaj sciigoj</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rAR/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rAR/strings.xml
new file mode 100644
index 0000000000..7a3a2ebc29
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rAR/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificaciones del sitio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rCL/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rCL/strings.xml
new file mode 100644
index 0000000000..834b5cf0d3
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rCL/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificaciones de sitio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rES/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rES/strings.xml
new file mode 100644
index 0000000000..7a3a2ebc29
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rES/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificaciones del sitio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rMX/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rMX/strings.xml
new file mode 100644
index 0000000000..7a3a2ebc29
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es-rMX/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificaciones del sitio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es/strings.xml
new file mode 100644
index 0000000000..7a3a2ebc29
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-es/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificaciones del sitio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-et/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-et/strings.xml
new file mode 100644
index 0000000000..f8eee716ea
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-et/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Saitide teavitused</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eu/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eu/strings.xml
new file mode 100644
index 0000000000..a0f49f1a9c
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-eu/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Gunearen jakinarazpenak</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fa/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fa/strings.xml
new file mode 100644
index 0000000000..3709340044
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fa/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">آگاهی‌های پایگاه</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ff/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ff/strings.xml
new file mode 100644
index 0000000000..18fb5ffccd
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ff/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Tintine lowre</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fi/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fi/strings.xml
new file mode 100644
index 0000000000..5eb417c3ec
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fi/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Sivustoilmoitukset</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fr/strings.xml
new file mode 100644
index 0000000000..c561a607a1
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notifications des sites web</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fur/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fur/strings.xml
new file mode 100644
index 0000000000..18e49fc239
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fur/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notifichis sîts</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fy-rNL/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fy-rNL/strings.xml
new file mode 100644
index 0000000000..9f1e8b9d27
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-fy-rNL/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Websitenotifikaasjes</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gd/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gd/strings.xml
new file mode 100644
index 0000000000..c9965f19dc
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gd/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Brathan na làraich</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gl/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gl/strings.xml
new file mode 100644
index 0000000000..0ac4b3dd7d
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gl/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificacións do sitio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gn/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gn/strings.xml
new file mode 100644
index 0000000000..cd8b29ec5c
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gn/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Tenda rehegua marandu</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gu-rIN/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gu-rIN/strings.xml
new file mode 100644
index 0000000000..7f516d26dd
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-gu-rIN/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">સાઇટ સૂચનાઓ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hi-rIN/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hi-rIN/strings.xml
new file mode 100644
index 0000000000..e7d38e44f6
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hi-rIN/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">साइट अधिसूचनाएं</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hr/strings.xml
new file mode 100644
index 0000000000..033ea3c325
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Obavijesti stranice</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hsb/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hsb/strings.xml
new file mode 100644
index 0000000000..19c94215b9
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hsb/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Sydłowe zdźělenki</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hu/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hu/strings.xml
new file mode 100644
index 0000000000..f387644b93
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hu/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Oldalértesítések</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hy-rAM/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hy-rAM/strings.xml
new file mode 100644
index 0000000000..6c610f6bd7
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-hy-rAM/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Կայքի ծանուցումներ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ia/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ia/strings.xml
new file mode 100644
index 0000000000..9632bdca23
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ia/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificationes de sito</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-in/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-in/strings.xml
new file mode 100644
index 0000000000..594fdb8d60
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-in/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notifikasi situs</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-is/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-is/strings.xml
new file mode 100644
index 0000000000..29c5c0b058
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-is/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Tilkynningar vefsvæðis</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-it/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-it/strings.xml
new file mode 100644
index 0000000000..cd6fa36634
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-it/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notifiche siti</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-iw/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-iw/strings.xml
new file mode 100644
index 0000000000..f681095fea
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-iw/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">התרעות אתר</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ja/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ja/strings.xml
new file mode 100644
index 0000000000..11e086f6ae
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ja/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">サイト通知</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ka/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ka/strings.xml
new file mode 100644
index 0000000000..6c57fe81fb
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ka/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">საიტის შეტყობინებები</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kaa/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kaa/strings.xml
new file mode 100644
index 0000000000..e03efbda15
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kaa/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Sayt xabarlamaları</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kab/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kab/strings.xml
new file mode 100644
index 0000000000..e4aae9397c
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kab/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Ilɣa n usmel</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kk/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kk/strings.xml
new file mode 100644
index 0000000000..cc75db3922
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kk/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Сайт хабарламалары</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kmr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kmr/strings.xml
new file mode 100644
index 0000000000..db9990fa40
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kmr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Danezanên malperê</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kn/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kn/strings.xml
new file mode 100644
index 0000000000..c14a6e8675
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-kn/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">ಜಾಲತಾಣದ ಸೂಚನೆಗಳು</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ko/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ko/strings.xml
new file mode 100644
index 0000000000..50db7cd6df
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ko/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">사이트 알림</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lo/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lo/strings.xml
new file mode 100644
index 0000000000..844ce35b60
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lo/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">ການແຈ້ງເຕືອນໃນເວັບໄຊທ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lt/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lt/strings.xml
new file mode 100644
index 0000000000..96ac1ef023
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-lt/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Svetainių pranešimai</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-mr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-mr/strings.xml
new file mode 100644
index 0000000000..96c80bd477
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-mr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">साइट सुचना</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-my/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-my/strings.xml
new file mode 100644
index 0000000000..531e3b1a6a
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-my/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">ဆိုက် အသိပေးချက်များ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nb-rNO/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nb-rNO/strings.xml
new file mode 100644
index 0000000000..d958cb46c5
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nb-rNO/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Nettstedsvarsler</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ne-rNP/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ne-rNP/strings.xml
new file mode 100644
index 0000000000..35544562bf
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ne-rNP/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">साइट सुचनाहरु</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nl/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nl/strings.xml
new file mode 100644
index 0000000000..2586eb5206
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nl/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Websitenotificaties</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nn-rNO/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nn-rNO/strings.xml
new file mode 100644
index 0000000000..8c38123b43
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-nn-rNO/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Nettstadvarsel</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-oc/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-oc/strings.xml
new file mode 100644
index 0000000000..fd1e22200b
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-oc/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificacions dels sites</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rIN/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rIN/strings.xml
new file mode 100644
index 0000000000..e9b6ffe70f
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rIN/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">ਸਾਈਟ ਸੂਚਨਾਵਾਂ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rPK/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rPK/strings.xml
new file mode 100644
index 0000000000..0512c7b594
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pa-rPK/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">سائٹ نوٹس</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pl/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pl/strings.xml
new file mode 100644
index 0000000000..61567690f2
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pl/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Powiadomienia witryn</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rBR/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rBR/strings.xml
new file mode 100644
index 0000000000..32bc1b219a
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rBR/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificações de sites</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rPT/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rPT/strings.xml
new file mode 100644
index 0000000000..32bc1b219a
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-pt-rPT/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificações de sites</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-rm/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-rm/strings.xml
new file mode 100644
index 0000000000..927790bd03
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-rm/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Communicaziuns da websites</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ro/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ro/strings.xml
new file mode 100644
index 0000000000..8c95a95f26
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ro/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notificări site</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ru/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ru/strings.xml
new file mode 100644
index 0000000000..432ae9fd21
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ru/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Уведомления сайтов</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sat/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sat/strings.xml
new file mode 100644
index 0000000000..c6cf24fecd
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sat/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">ᱥᱟᱭᱤᱴ ᱨᱮᱭᱟᱜ ᱤᱛᱞᱟᱹᱭ ᱠᱚ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sc/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sc/strings.xml
new file mode 100644
index 0000000000..cd68d1b150
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sc/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Notìficas de su situ</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-si/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-si/strings.xml
new file mode 100644
index 0000000000..c91549c4fa
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-si/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">අඩවියේ දැනුම්දීම්</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sk/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sk/strings.xml
new file mode 100644
index 0000000000..a63d5f6b7c
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sk/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Upozornenia stránok</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-skr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-skr/strings.xml
new file mode 100644
index 0000000000..ef5f54b582
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-skr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">سائٹ نوٹیفیکیشن</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sl/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sl/strings.xml
new file mode 100644
index 0000000000..06f8bccd33
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sl/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Obvestila strani</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sq/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sq/strings.xml
new file mode 100644
index 0000000000..588b8ad287
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sq/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Njoftime sajti</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sr/strings.xml
new file mode 100644
index 0000000000..12362cec74
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Обавештења странице</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-su/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-su/strings.xml
new file mode 100644
index 0000000000..11e059398b
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-su/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Iber loka</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sv-rSE/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sv-rSE/strings.xml
new file mode 100644
index 0000000000..3d642114cf
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-sv-rSE/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Webbplatsaviseringar</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ta/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ta/strings.xml
new file mode 100644
index 0000000000..794f309489
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ta/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">தள அறிவிப்புகள்</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-te/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-te/strings.xml
new file mode 100644
index 0000000000..606a5636ab
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-te/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">సైటు గమనింపులు</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tg/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tg/strings.xml
new file mode 100644
index 0000000000..57dca039c5
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tg/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Огоҳномаҳои сомона</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-th/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-th/strings.xml
new file mode 100644
index 0000000000..4f012888fe
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-th/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">การแจ้งเตือนไซต์</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tl/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tl/strings.xml
new file mode 100644
index 0000000000..90dbfa374b
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tl/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Mga abiso ng site</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tok/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tok/strings.xml
new file mode 100644
index 0000000000..6c13a3bcca
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tok/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">sona sin tan lipu</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tr/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tr/strings.xml
new file mode 100644
index 0000000000..19190c551c
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tr/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Site bildirimleri</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-trs/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-trs/strings.xml
new file mode 100644
index 0000000000..e007bfd0f4
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-trs/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Nej sa atāj na\'ānj dàj hua riña sîtio</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tt/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tt/strings.xml
new file mode 100644
index 0000000000..8eacd49cee
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tt/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Сайт искәртүләре</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tzm/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tzm/strings.xml
new file mode 100644
index 0000000000..1b4ccb8fdf
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-tzm/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Tineɣmisin n wasiten</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ug/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ug/strings.xml
new file mode 100644
index 0000000000..5191c3d44a
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ug/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">بېكەت ئۇقتۇرۇشى</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uk/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uk/strings.xml
new file mode 100644
index 0000000000..23843478b6
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uk/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Сповіщення сайтів</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ur/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ur/strings.xml
new file mode 100644
index 0000000000..6dc6506d02
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-ur/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">سائٹ ‏کے ‏اعلانات</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uz/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uz/strings.xml
new file mode 100644
index 0000000000..97cdc8fa8d
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-uz/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Sayt bildirishnomalari</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-vi/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-vi/strings.xml
new file mode 100644
index 0000000000..e0792efcf1
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-vi/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Các thông báo trang</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-yo/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-yo/strings.xml
new file mode 100644
index 0000000000..2bde7e11df
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-yo/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Àwọn ìtalólobó sáìtì</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rCN/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000000..f4ba672caa
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rCN/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">网站通知</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rTW/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000000..689d463d86
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values-zh-rTW/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">網站通知</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/main/res/values/strings.xml b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..d5499eb740
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/main/res/values/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<resources>
+ <!-- Default Web Notification Channel Name. -->
+ <string name="mozac_feature_notification_channel_name">Site notifications</string>
+</resources>
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/NativeNotificationBridgeTest.kt b/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/NativeNotificationBridgeTest.kt
new file mode 100644
index 0000000000..364e6cda16
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/NativeNotificationBridgeTest.kt
@@ -0,0 +1,140 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package mozilla.components.feature.webnotifications
+
+import android.app.Notification
+import android.app.Notification.BigTextStyle
+import android.app.Notification.EXTRA_SUB_TEXT
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import kotlinx.coroutines.CompletableDeferred
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.runTest
+import mozilla.components.browser.icons.BrowserIcons
+import mozilla.components.browser.icons.Icon
+import mozilla.components.browser.icons.IconRequest
+import mozilla.components.browser.icons.IconRequest.Resource
+import mozilla.components.browser.icons.IconRequest.Resource.Type.MANIFEST_ICON
+import mozilla.components.browser.icons.IconRequest.Size.DEFAULT
+import mozilla.components.concept.engine.webnotifications.WebNotification
+import mozilla.components.support.test.any
+import mozilla.components.support.test.mock
+import mozilla.components.support.test.robolectric.testContext
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNotEquals
+import org.junit.Assert.assertNotNull
+import org.junit.Assert.assertNull
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.doReturn
+import org.mockito.Mockito.verify
+
+private const val TEST_TITLE = "test title"
+private const val TEST_TAG = "test tag"
+private const val TEST_TEXT = "test text"
+private const val TEST_URL = "mozilla.org"
+private const val TEST_CHANNEL = "testChannel"
+
+@ExperimentalCoroutinesApi // for runTest
+@RunWith(AndroidJUnit4::class)
+class NativeNotificationBridgeTest {
+ private val blankNotification = WebNotification(
+ TEST_TITLE, TEST_TAG, TEST_TEXT, TEST_URL, null, null,
+ null, true, mock(), 0, privateBrowsing = false,
+ )
+
+ private lateinit var icons: BrowserIcons
+ private lateinit var bridge: NativeNotificationBridge
+
+ @Before
+ fun setup() {
+ icons = mock()
+ bridge = NativeNotificationBridge(icons, android.R.drawable.ic_dialog_alert)
+
+ val mockIcon = Icon(mock(), source = Icon.Source.GENERATOR)
+ doReturn(CompletableDeferred(mockIcon)).`when`(icons).loadIcon(any())
+ }
+
+ @Test
+ fun `create blank notification`() = runTest {
+ val notification = bridge.convertToAndroidNotification(
+ blankNotification,
+ testContext,
+ TEST_CHANNEL,
+ null,
+ 0,
+ )
+
+ assertNull(notification.actions)
+ assertEquals(TEST_CHANNEL, notification.channelId)
+ assertEquals(0, notification.`when`)
+ assertNotNull(notification.smallIcon)
+ assertNull(notification.getLargeIcon())
+ assertTrue(notification.extras.containsKey(EXTRA_SUB_TEXT))
+ }
+
+ @Test
+ fun `set when`() = runTest {
+ val notification = bridge.convertToAndroidNotification(
+ blankNotification.copy(timestamp = 1234567890),
+ testContext,
+ TEST_CHANNEL,
+ null,
+ 0,
+ )
+
+ assertEquals(1234567890, notification.`when`)
+ }
+
+ @Test
+ fun `icon is loaded from BrowserIcons`() = runTest {
+ bridge.convertToAndroidNotification(
+ blankNotification.copy(sourceUrl = "https://example.com", iconUrl = "https://example.com/large.png"),
+ testContext,
+ TEST_CHANNEL,
+ null,
+ 0,
+ )
+
+ verify(icons).loadIcon(
+ IconRequest(
+ url = "https://example.com",
+ size = DEFAULT,
+ resources = listOf(
+ Resource(
+ url = "https://example.com/large.png",
+ type = MANIFEST_ICON,
+ ),
+ ),
+ isPrivate = true,
+ ),
+ )
+ }
+
+ @Test
+ fun `android notification sets BigTextStyle`() = runTest {
+ val notification = bridge.convertToAndroidNotification(
+ blankNotification.copy(iconUrl = "https://example.com/large.png"),
+ testContext,
+ TEST_CHANNEL,
+ null,
+ 0,
+ )
+
+ val expectedStyle = BigTextStyle().javaClass.name
+ assertEquals(expectedStyle, notification.extras.getString(Notification.EXTRA_TEMPLATE))
+
+ val noBodyNotification = bridge.convertToAndroidNotification(
+ blankNotification.copy(iconUrl = "https://example.com/large.png", body = null),
+ testContext,
+ TEST_CHANNEL,
+ null,
+ 0,
+ )
+
+ assertNotEquals(expectedStyle, noBodyNotification.extras.getString(Notification.EXTRA_TEMPLATE))
+ }
+}
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationFeatureTest.kt b/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationFeatureTest.kt
new file mode 100644
index 0000000000..9fcb9fb05a
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationFeatureTest.kt
@@ -0,0 +1,220 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package mozilla.components.feature.webnotifications
+
+import androidx.core.app.NotificationChannelCompat
+import androidx.core.app.NotificationManagerCompat
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import kotlinx.coroutines.CompletableDeferred
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import mozilla.components.browser.icons.BrowserIcons
+import mozilla.components.browser.icons.Icon
+import mozilla.components.browser.icons.Icon.Source
+import mozilla.components.concept.engine.Engine
+import mozilla.components.concept.engine.permission.SitePermissions
+import mozilla.components.concept.engine.permission.SitePermissions.Status
+import mozilla.components.concept.engine.webnotifications.WebNotification
+import mozilla.components.feature.sitepermissions.OnDiskSitePermissionsStorage
+import mozilla.components.support.base.android.NotificationsDelegate
+import mozilla.components.support.test.any
+import mozilla.components.support.test.eq
+import mozilla.components.support.test.mock
+import mozilla.components.support.test.robolectric.testContext
+import mozilla.components.support.test.rule.MainCoroutineRule
+import mozilla.components.support.test.rule.runTestOnMain
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.anyBoolean
+import org.mockito.Mockito.doNothing
+import org.mockito.Mockito.never
+import org.mockito.Mockito.spy
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+
+@ExperimentalCoroutinesApi
+@RunWith(AndroidJUnit4::class)
+class WebNotificationFeatureTest {
+
+ @get:Rule
+ val coroutinesTestRule = MainCoroutineRule()
+
+ private val context = spy(testContext)
+ private val browserIcons: BrowserIcons = mock()
+ private val icon: Icon = mock()
+ private val engine: Engine = mock()
+ private val notificationManager: NotificationManagerCompat = mock()
+ private val permissionsStorage: OnDiskSitePermissionsStorage = mock()
+ private val notificationsDelegate: NotificationsDelegate = mock()
+
+ private val testNotification = WebNotification(
+ "Mozilla",
+ "mozilla.org",
+ "Notification body",
+ "mozilla.org",
+ "https://mozilla.org/image.ico",
+ "rtl",
+ "en",
+ false,
+ mock(),
+ privateBrowsing = false,
+ )
+
+ @Before
+ fun setup() {
+ `when`(notificationsDelegate.notificationManagerCompat).thenReturn(notificationManager)
+ `when`(icon.source).thenReturn(Source.GENERATOR) // to no-op the browser icons call.
+ `when`(browserIcons.loadIcon(any())).thenReturn(CompletableDeferred(icon))
+ }
+
+ @Test
+ fun `register web notification delegate`() {
+ doNothing().`when`(engine).registerWebNotificationDelegate(any())
+ doNothing().`when`(notificationManager).createNotificationChannel(any<NotificationChannelCompat>())
+
+ WebNotificationFeature(
+ context,
+ engine,
+ browserIcons,
+ android.R.drawable.ic_dialog_alert,
+ mock(),
+ null,
+ notificationsDelegate = notificationsDelegate,
+ )
+
+ verify(engine).registerWebNotificationDelegate(any())
+ }
+
+ @Test
+ fun `engine notifies to cancel notification`() {
+ val webNotification: WebNotification = mock()
+ val feature = WebNotificationFeature(
+ context,
+ engine,
+ browserIcons,
+ android.R.drawable.ic_dialog_alert,
+ mock(),
+ null,
+ notificationsDelegate = notificationsDelegate,
+ )
+
+ `when`(webNotification.tag).thenReturn("testTag")
+
+ feature.onCloseNotification(webNotification)
+
+ verify(notificationManager).cancel("testTag", NOTIFICATION_ID)
+ }
+
+ @Test
+ fun `engine notifies to show notification`() = runTestOnMain {
+ val notification = testNotification.copy(sourceUrl = "https://mozilla.org:443")
+ val feature = WebNotificationFeature(
+ context,
+ engine,
+ browserIcons,
+ android.R.drawable.ic_dialog_alert,
+ permissionsStorage,
+ null,
+ coroutineContext,
+ notificationsDelegate = notificationsDelegate,
+ )
+
+ val permission = SitePermissions(origin = "https://mozilla.org:443", notification = Status.ALLOWED, savedAt = 0)
+
+ `when`(
+ permissionsStorage.findSitePermissionsBy(
+ any(),
+ anyBoolean(),
+ anyBoolean(),
+ ),
+ ).thenReturn(permission)
+
+ feature.onShowNotification(notification)
+
+ verify(notificationsDelegate).notify(
+ eq(notification.tag),
+ eq(NOTIFICATION_ID),
+ any(),
+ any(),
+ any(),
+ eq(false),
+ )
+ }
+
+ @Test
+ fun `notification ignored if permissions are not allowed`() = runTestOnMain {
+ val notification = testNotification.copy(sourceUrl = "https://mozilla.org:443")
+ val feature = WebNotificationFeature(
+ context,
+ engine,
+ browserIcons,
+ android.R.drawable.ic_dialog_alert,
+ mock(),
+ null,
+ notificationsDelegate = notificationsDelegate,
+ )
+
+ // No permissions found.
+
+ feature.onShowNotification(notification)
+
+ verify(notificationManager, never()).notify(eq(testNotification.tag), eq(NOTIFICATION_ID), any())
+
+ // When explicitly denied.
+
+ val permission = SitePermissions(origin = "https://mozilla.org:443", notification = Status.BLOCKED, savedAt = 0)
+ `when`(
+ permissionsStorage.findSitePermissionsBy(
+ any(),
+ anyBoolean(),
+ anyBoolean(),
+ ),
+ ).thenReturn(permission)
+
+ feature.onShowNotification(testNotification)
+
+ verify(notificationManager, never()).notify(eq(testNotification.tag), eq(NOTIFICATION_ID), any())
+ }
+
+ @Test
+ fun `notifications always allowed for web extensions`() = runTestOnMain {
+ val webExtensionNotification = WebNotification(
+ "Mozilla",
+ "mozilla.org",
+ "Notification body",
+ "mozilla.org",
+ "https://mozilla.org/image.ico",
+ "rtl",
+ "en",
+ false,
+ mock(),
+ triggeredByWebExtension = true,
+ privateBrowsing = true,
+ )
+
+ val feature = WebNotificationFeature(
+ context,
+ engine,
+ browserIcons,
+ android.R.drawable.ic_dialog_alert,
+ permissionsStorage,
+ null,
+ coroutineContext,
+ notificationsDelegate = notificationsDelegate,
+ )
+
+ feature.onShowNotification(webExtensionNotification)
+
+ verify(notificationsDelegate).notify(
+ eq(testNotification.tag),
+ eq(NOTIFICATION_ID),
+ any(),
+ any(),
+ any(),
+ eq(false),
+ )
+ }
+}
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessorTest.kt b/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessorTest.kt
new file mode 100644
index 0000000000..df20bced9e
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/test/java/mozilla/components/feature/webnotifications/WebNotificationIntentProcessorTest.kt
@@ -0,0 +1,51 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package mozilla.components.feature.webnotifications
+
+import android.content.Intent
+import android.os.Parcelable
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import mozilla.components.concept.engine.Engine
+import mozilla.components.support.test.mock
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertTrue
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.verify
+
+@RunWith(AndroidJUnit4::class)
+class WebNotificationIntentProcessorTest {
+ private val engine: Engine = mock()
+ private val processor = WebNotificationIntentProcessor(engine)
+
+ @Test
+ fun `GIVEN an Intent WHEN it contains a parcelable with our private key THEN processing is successful`() {
+ val notification = mock<Parcelable>()
+ val intent = Intent().putExtra(NativeNotificationBridge.EXTRA_ON_CLICK, notification)
+
+ val result = processor.process(intent)
+
+ assertTrue(result)
+ }
+
+ @Test
+ fun `GIVEN an Intent WHEN it does not contain a parcelable with our private key THEN fail at processing the intent`() {
+ val intent = Intent()
+
+ val result = processor.process(intent)
+
+ assertFalse(result)
+ }
+
+ @Test
+ fun `GIVEN an Intent WHEN it contains a parcelable with our private key THEN delegate the engine to handle it`() {
+ val notification = mock<Parcelable>()
+ val intent = Intent().putExtra(NativeNotificationBridge.EXTRA_ON_CLICK, notification)
+
+ processor.process(intent)
+
+ verify(engine).handleWebNotificationClick(notification)
+ }
+}
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/mobile/android/android-components/components/feature/webnotifications/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
new file mode 100644
index 0000000000..cf1c399ea8
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
@@ -0,0 +1,2 @@
+mock-maker-inline
+// This allows mocking final classes (classes are final by default in Kotlin)
diff --git a/mobile/android/android-components/components/feature/webnotifications/src/test/resources/robolectric.properties b/mobile/android/android-components/components/feature/webnotifications/src/test/resources/robolectric.properties
new file mode 100644
index 0000000000..932b01b9eb
--- /dev/null
+++ b/mobile/android/android-components/components/feature/webnotifications/src/test/resources/robolectric.properties
@@ -0,0 +1 @@
+sdk=28