From 83ca82f749a025fc09f9c1c026454a2f5eb915a7 Mon Sep 17 00:00:00 2001 From: Alison Cichowlas Date: Thu, 15 Mar 2018 18:07:27 -0400 Subject: [PATCH] Sort Uncategorized channel to the bottom. Bug: 64803214 Test: manual, with Duo app Change-Id: I8e39fbed4ecda2efebb4606f38ea934647317207 --- .../settings/notification/NotificationSettingsBase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/settings/notification/NotificationSettingsBase.java b/src/com/android/settings/notification/NotificationSettingsBase.java index a4310a10f5d..01f9e881f16 100644 --- a/src/com/android/settings/notification/NotificationSettingsBase.java +++ b/src/com/android/settings/notification/NotificationSettingsBase.java @@ -355,7 +355,13 @@ abstract public class NotificationSettingsBase extends DashboardFragment { (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()); };