Automated cherry pick of #3590 (#3591)

* Create notification channels only if supported

* Update comment
This commit is contained in:
Mattermost Build 2019-11-21 17:16:33 +01:00 committed by Elias Nahum
parent 259990ef57
commit b0516abebf

View file

@ -507,6 +507,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);