|
18 | 18 | import static com.google.firebase.appdistribution.impl.FirebaseAppDistributionNotificationsManager.NotificationType.FEEDBACK; |
19 | 19 | import static java.util.concurrent.TimeUnit.SECONDS; |
20 | 20 |
|
| 21 | +import android.annotation.SuppressLint; |
21 | 22 | import android.app.Activity; |
22 | 23 | import android.app.Notification; |
23 | 24 | import android.app.NotificationChannel; |
@@ -97,6 +98,9 @@ enum NotificationType { |
97 | 98 | this.uiThreadExecutor = uiThreadExecutor; |
98 | 99 | } |
99 | 100 |
|
| 101 | + // Suppress lint as `areNotificationsEnabled()` verifies whether the notification can be send, |
| 102 | + // including API 33+. Developers are expected to ask for notification permissions themselves. |
| 103 | + @SuppressLint("MissingPermission") |
100 | 104 | void showAppUpdateNotification(long totalBytes, long downloadedBytes, int stringResourceId) { |
101 | 105 | // Create the NotificationChannel, but only on API 26+ because |
102 | 106 | // the NotificationChannel class is new and not in the support library |
@@ -179,7 +183,8 @@ public void showFeedbackNotification( |
179 | 183 | }); |
180 | 184 | } |
181 | 185 |
|
182 | | - // this must be run on the main (UI) thread |
| 186 | + // This must be run on the main (UI) thread. |
| 187 | + @SuppressLint("MissingPermission") |
183 | 188 | private void doShowFeedbackNotification() { |
184 | 189 | LogWrapper.i(TAG, "Showing feedback notification"); |
185 | 190 | notificationManager.notify(FEEDBACK.tag, FEEDBACK.id, feedbackNotificationToBeShown); |
|
0 commit comments