Skip to content

Commit

Permalink
Suppress lint warnings for app distro
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazo committed Dec 10, 2024
1 parent 1621eaf commit 128fcb8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 128fcb8

Please sign in to comment.