Merge "If two groups are posted to settings, remove old group and log." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9fa5e66a66
@@ -51,7 +51,6 @@ import com.android.settings.widget.MasterSwitchPreference;
|
|||||||
import com.android.settings.widget.SwitchBar;
|
import com.android.settings.widget.SwitchBar;
|
||||||
import com.android.settingslib.RestrictedSwitchPreference;
|
import com.android.settingslib.RestrictedSwitchPreference;
|
||||||
|
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -147,6 +146,15 @@ public class AppNotificationSettings extends NotificationSettingsBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void populateChannelList() {
|
private void populateChannelList() {
|
||||||
|
if (!mChannelGroups.isEmpty()) {
|
||||||
|
// If there's anything in mChannelGroups, we've called populateChannelList twice.
|
||||||
|
// Clear out existing channels and log.
|
||||||
|
Log.w(TAG, "Notification channel group posted twice to settings - old size " +
|
||||||
|
mChannelGroups.size() + ", new size " + mChannelGroupList.size());
|
||||||
|
for (Preference p : mChannelGroups) {
|
||||||
|
getPreferenceScreen().removePreference(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (mChannelGroupList.isEmpty()) {
|
if (mChannelGroupList.isEmpty()) {
|
||||||
PreferenceCategory groupCategory = new PreferenceCategory(getPrefContext());
|
PreferenceCategory groupCategory = new PreferenceCategory(getPrefContext());
|
||||||
groupCategory.setTitle(R.string.notification_channels);
|
groupCategory.setTitle(R.string.notification_channels);
|
||||||
|
Reference in New Issue
Block a user