|
32 | 32 | import java.io.IOException; |
33 | 33 | import java.io.InterruptedIOException; |
34 | 34 | import java.net.SocketException; |
35 | | -import java.util.Arrays; |
| 35 | +import java.util.ArrayList; |
36 | 36 | import java.util.Collections; |
37 | 37 | import java.util.List; |
38 | 38 |
|
@@ -225,45 +225,44 @@ protected void initACRA() { |
225 | 225 | private void initNotificationChannels() { |
226 | 226 | // Keep the importance below DEFAULT to avoid making noise on every notification update for |
227 | 227 | // the main and update channels |
228 | | - final NotificationChannelCompat mainChannel = new NotificationChannelCompat |
| 228 | + final List<NotificationChannelCompat> notificationChannelCompats = new ArrayList<>(); |
| 229 | + notificationChannelCompats.add(new NotificationChannelCompat |
229 | 230 | .Builder(getString(R.string.notification_channel_id), |
230 | 231 | NotificationManagerCompat.IMPORTANCE_LOW) |
231 | 232 | .setName(getString(R.string.notification_channel_name)) |
232 | 233 | .setDescription(getString(R.string.notification_channel_description)) |
233 | | - .build(); |
| 234 | + .build()); |
234 | 235 |
|
235 | | - final NotificationChannelCompat appUpdateChannel = new NotificationChannelCompat |
| 236 | + notificationChannelCompats.add(new NotificationChannelCompat |
236 | 237 | .Builder(getString(R.string.app_update_notification_channel_id), |
237 | 238 | NotificationManagerCompat.IMPORTANCE_LOW) |
238 | 239 | .setName(getString(R.string.app_update_notification_channel_name)) |
239 | 240 | .setDescription(getString(R.string.app_update_notification_channel_description)) |
240 | | - .build(); |
| 241 | + .build()); |
241 | 242 |
|
242 | | - final NotificationChannelCompat hashChannel = new NotificationChannelCompat |
| 243 | + notificationChannelCompats.add(new NotificationChannelCompat |
243 | 244 | .Builder(getString(R.string.hash_channel_id), |
244 | 245 | NotificationManagerCompat.IMPORTANCE_HIGH) |
245 | 246 | .setName(getString(R.string.hash_channel_name)) |
246 | 247 | .setDescription(getString(R.string.hash_channel_description)) |
247 | | - .build(); |
| 248 | + .build()); |
248 | 249 |
|
249 | | - final NotificationChannelCompat errorReportChannel = new NotificationChannelCompat |
| 250 | + notificationChannelCompats.add(new NotificationChannelCompat |
250 | 251 | .Builder(getString(R.string.error_report_channel_id), |
251 | 252 | NotificationManagerCompat.IMPORTANCE_LOW) |
252 | 253 | .setName(getString(R.string.error_report_channel_name)) |
253 | 254 | .setDescription(getString(R.string.error_report_channel_description)) |
254 | | - .build(); |
| 255 | + .build()); |
255 | 256 |
|
256 | | - |
257 | | - final NotificationChannelCompat newStreamsChannel = new NotificationChannelCompat |
| 257 | + notificationChannelCompats.add(new NotificationChannelCompat |
258 | 258 | .Builder(getString(R.string.streams_notification_channel_id), |
259 | 259 | NotificationManagerCompat.IMPORTANCE_DEFAULT) |
260 | 260 | .setName(getString(R.string.streams_notification_channel_name)) |
261 | 261 | .setDescription(getString(R.string.streams_notification_channel_description)) |
262 | | - .build(); |
| 262 | + .build()); |
263 | 263 |
|
264 | 264 | final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); |
265 | | - notificationManager.createNotificationChannelsCompat(Arrays.asList(mainChannel, |
266 | | - appUpdateChannel, hashChannel, errorReportChannel, newStreamsChannel)); |
| 265 | + notificationManager.createNotificationChannelsCompat(notificationChannelCompats); |
267 | 266 | } |
268 | 267 |
|
269 | 268 | protected boolean isDisposedRxExceptionsReported() { |
|
0 commit comments