diff --git a/src/com/android/settings/notification/app/AppChannelsBypassingDndPreferenceController.java b/src/com/android/settings/notification/app/AppChannelsBypassingDndPreferenceController.java index 684a27a8ae8..297bfdb97bb 100644 --- a/src/com/android/settings/notification/app/AppChannelsBypassingDndPreferenceController.java +++ b/src/com/android/settings/notification/app/AppChannelsBypassingDndPreferenceController.java @@ -59,7 +59,7 @@ public class AppChannelsBypassingDndPreferenceController extends NotificationPre private RestrictedSwitchPreference mAllNotificationsToggle; private PreferenceCategory mPreferenceCategory; - private final List mChannels = new ArrayList<>(); + private List mChannels = new ArrayList<>(); public AppChannelsBypassingDndPreferenceController( Context context, @@ -126,17 +126,18 @@ public class AppChannelsBypassingDndPreferenceController extends NotificationPre new AsyncTask() { @Override protected Void doInBackground(Void... unused) { + List newChannelList = new ArrayList<>(); List mChannelGroupList = mBackend.getGroups(mAppRow.pkg, mAppRow.uid).getList(); - mChannels.clear(); for (NotificationChannelGroup channelGroup : mChannelGroupList) { for (NotificationChannel channel : channelGroup.getChannels()) { if (!isConversation(channel)) { - mChannels.add(channel); + newChannelList.add(channel); } } } - Collections.sort(mChannels, CHANNEL_COMPARATOR); + Collections.sort(newChannelList, CHANNEL_COMPARATOR); + mChannels = newChannelList; return null; }