List of usage examples for android.app NotificationManager getNotificationChannelGroups
public List<NotificationChannelGroup> getNotificationChannelGroups()
From source file:com.irccloud.android.data.collection.NotificationsList.java
public void pruneNotificationChannels() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationManager nm = ((NotificationManager) IRCCloudApplication.getInstance() .getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE)); for (NotificationChannelGroup c : nm.getNotificationChannelGroups()) { try { if (ServersList.getInstance().getServer(Integer.valueOf(c.getId())) == null) nm.deleteNotificationChannelGroup(c.getId()); } catch (NumberFormatException e) { }/* w w w. j a v a2 s .c o m*/ } for (NotificationChannel c : nm.getNotificationChannels()) { try { if (BuffersList.getInstance().getBuffer(Integer.valueOf(c.getId())) == null) nm.deleteNotificationChannel(c.getId()); } catch (NumberFormatException e) { } } } }