Merge "Fix doubling of channel listing"

This commit is contained in:
TreeHugger Robot
2019-02-15 22:46:15 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 2 deletions

View File

@@ -252,7 +252,7 @@ public class AppNotificationSettings extends NotificationSettingsBase {
int childCount = groupGroup.getPreferenceCount();
for (int i = 0; i < childCount; i++) {
Preference pref = groupGroup.getPreference(i);
if (pref instanceof MasterCheckBoxPreference) {
if (pref instanceof ChannelSummaryPreference) {
toRemove.add(pref);
}
}

View File

@@ -309,7 +309,9 @@ abstract public class NotificationSettingsBase extends DashboardFragment {
return true;
}
});
parent.addPreference(channelPref);
if (parent.findPreference(channelPref.getKey()) == null) {
parent.addPreference(channelPref);
}
return channelPref;
}