From 128fcb88d18103c926613561f4cb0f998efbee02 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Tue, 10 Dec 2024 13:48:54 -0500 Subject: [PATCH] Suppress lint warnings for app distro --- .../impl/FirebaseAppDistributionNotificationsManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionNotificationsManager.java b/firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionNotificationsManager.java index 919b66f85b1..511ae7c835a 100644 --- a/firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionNotificationsManager.java +++ b/firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionNotificationsManager.java @@ -18,6 +18,7 @@ import static com.google.firebase.appdistribution.impl.FirebaseAppDistributionNotificationsManager.NotificationType.FEEDBACK; import static java.util.concurrent.TimeUnit.SECONDS; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.Notification; import android.app.NotificationChannel; @@ -97,6 +98,9 @@ enum NotificationType { this.uiThreadExecutor = uiThreadExecutor; } + // Suppress lint as `areNotificationsEnabled()` verifies whether the notification can be send, + // including API 33+. Developers are expected to ask for notification permissions themselves. + @SuppressLint("MissingPermission") void showAppUpdateNotification(long totalBytes, long downloadedBytes, int stringResourceId) { // Create the NotificationChannel, but only on API 26+ because // the NotificationChannel class is new and not in the support library @@ -179,7 +183,8 @@ public void showFeedbackNotification( }); } - // this must be run on the main (UI) thread + // This must be run on the main (UI) thread. + @SuppressLint("MissingPermission") private void doShowFeedbackNotification() { LogWrapper.i(TAG, "Showing feedback notification"); notificationManager.notify(FEEDBACK.tag, FEEDBACK.id, feedbackNotificationToBeShown);