DND Bypassing Apps redesign

- Add link in DND Conversations Page to the overall conversations list
Settings page
- Add custom_rule xml pages for custom schedule rule settings for
messages and calls (so the UI is the same as before the message/calls
redesign)
- Change app exceptions to display apps with subtext indicating which
notitfication channels are allowed to bypass dnd (previously, would
display each channel individually)
- Add individual AppBypassDnd channel pages where users can decide which
channels will bypass DND for an app on a single page
(AppChannelsBypassingDndSettings)
- Only remove dnd bypassing apps preferences from the preference list if the list changed,
else just update the preference itself to avoid the list from flashing

Test: make RunSettingsRoboTests7
Bug: 151845457
Change-Id: If12d8921e1405aefb1066acc2ef5c55d216fe47a
This commit is contained in:
Beverly
2020-03-24 08:54:30 -04:00
committed by Beverly Tai
parent cb90ffafbb
commit f707950ee7
26 changed files with 1128 additions and 523 deletions

View File

@@ -35,6 +35,7 @@ import com.android.settings.notification.NotificationBackend;
import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.core.AbstractPreferenceController;
import java.util.Comparator;
import java.util.Objects;
/**
@@ -172,4 +173,31 @@ public abstract class NotificationPreferenceController extends AbstractPreferenc
}
return Objects.equals(NotificationChannel.DEFAULT_CHANNEL_ID, mChannel.getId());
}
public static final Comparator<NotificationChannelGroup> CHANNEL_GROUP_COMPARATOR =
new Comparator<NotificationChannelGroup>() {
@Override
public int compare(NotificationChannelGroup left, NotificationChannelGroup right) {
// Non-grouped channels (in placeholder group with a null id) come last
if (left.getId() == null && right.getId() != null) {
return 1;
} else if (right.getId() == null && left.getId() != null) {
return -1;
}
return left.getId().compareTo(right.getId());
}
};
public static final Comparator<NotificationChannel> CHANNEL_COMPARATOR = (left, right) -> {
if (left.isDeleted() != right.isDeleted()) {
return Boolean.compare(left.isDeleted(), right.isDeleted());
} else if (left.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {
// Uncategorized/miscellaneous legacy channel goes last
return 1;
} else if (right.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {
return -1;
}
return left.getId().compareTo(right.getId());
};
}