Automated cherry pick of #3590 (#3592)

* Create notification channels only if supported

* Update comment
This commit is contained in:
Mattermost Build 2019-11-21 17:18:04 +01:00 committed by Elias Nahum
parent dd0f424a63
commit 9b08098572

View file

@ -530,6 +530,11 @@ public class CustomPushNotification extends PushNotification {
}
private void createNotificationChannels() {
// Notification channels are not supported in Android Nougat and below
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return;
}
final NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
mHighImportanceChannel = new NotificationChannel("channel_01", "High Importance", NotificationManager.IMPORTANCE_HIGH);