Notification improvements

This commit is contained in:
M66B
2019-11-12 10:57:26 +01:00
parent 3951e656cc
commit e883ef4cd5
4 changed files with 36 additions and 22 deletions

View File

@@ -2318,8 +2318,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@TargetApi(Build.VERSION_CODES.O)
private void onNotifyContact(final TupleMessageEx message) {
final NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
final InternetAddress from = (InternetAddress) message.from[0];
final String channelId = "notification." + from.getAddress().toLowerCase(Locale.ROOT);
final String channelId = message.getNotificationChannelId();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, ibAddContact);
NotificationChannel channel = nm.getNotificationChannel(channelId);
@@ -2358,6 +2357,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return;
}
InternetAddress from = (InternetAddress) message.from[0];
NotificationChannel channel = new NotificationChannel(
channelId, from.getAddress(),
NotificationManager.IMPORTANCE_HIGH);