Skip to content

Commit 302ddf5

Browse files
rvandermeulenmergify[bot]
authored andcommitted
Suppress MissingPermission linter warning.
1 parent 375c456 commit 302ddf5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/src/main/java/org/mozilla/reference/browser/NotificationManager.kt

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package org.mozilla.reference.browser
66

7+
import android.annotation.SuppressLint
78
import android.app.Notification
89
import android.app.NotificationChannel
910
import android.app.PendingIntent
@@ -48,6 +49,14 @@ object NotificationManager {
4849

4950
private val logger = Logger("NotificationManager")
5051

52+
/**
53+
* Displays a notification for each valid tab received from a device.
54+
*
55+
* @param context The Android application context.
56+
* @param device The device from which the tabs were received, or `null` if unavailable.
57+
* @param tabs A list of tabs to be displayed.
58+
*/
59+
@SuppressLint("MissingPermission", "NotifyUsage")
5160
fun showReceivedTabs(context: Context, device: Device?, tabs: List<TabData>) {
5261
// In the future, experiment with displaying multiple tabs from the same device as as Notification Groups.
5362
// For now, a single notification per tab received will suffice.
@@ -117,6 +126,7 @@ object NotificationManager {
117126
/**
118127
* Launch a notification of the data policy, and record notification time and version.
119128
*/
129+
@SuppressLint("MissingPermission", "NotifyUsage")
120130
private fun notifyDataPolicy(context: Context, preferences: SharedPreferences) {
121131
val resources = context.resources
122132

config/detekt-baseline.xml

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
<ID>UndocumentedPublicFunction:ExternalAppBrowserFragment.kt$ExternalAppBrowserFragment.Companion$fun create( sessionId: String, manifest: WebAppManifest?, trustedScopes: List&lt;Uri&gt;, )</ID>
8181
<ID>UndocumentedPublicFunction:Long.kt$@Suppress("MagicNumber") fun Long.timeSince(context: Context, time: Long): String</ID>
8282
<ID>UndocumentedPublicFunction:NotificationManager.kt$NotificationManager$fun checkAndNotifyPolicy(context: Context)</ID>
83-
<ID>UndocumentedPublicFunction:NotificationManager.kt$NotificationManager$fun showReceivedTabs(context: Context, device: Device?, tabs: List&lt;TabData&gt;)</ID>
8483
<ID>UndocumentedPublicFunction:PictureInPictureIntegration.kt$PictureInPictureIntegration$fun onHomePressed()</ID>
8584
<ID>UndocumentedPublicFunction:Settings.kt$Settings$fun getOverrideAmoCollection(context: Context): String</ID>
8685
<ID>UndocumentedPublicFunction:Settings.kt$Settings$fun getOverrideAmoUser(context: Context): String</ID>

0 commit comments

Comments
 (0)