Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -334,20 +334,20 @@ public class RankingCoordinatorTest extends SysuiTestCase { public void testSilentSectionComparator_sortsBundlesByPrefixedKeys() { // This is the sorted order BundleEntry socialBundle = new BundleEntry(BundleSpec.Companion.getSOCIAL_MEDIA()); BundleEntry promoBundle = new BundleEntry(BundleSpec.Companion.getPROMOTIONS()); BundleEntry newsBundle = new BundleEntry(BundleSpec.Companion.getNEWS()); BundleEntry recsBundle = new BundleEntry(BundleSpec.Companion.getRECOMMENDED()); BundleEntry promoBundle = new BundleEntry(BundleSpec.Companion.getPROMOTIONS()); // Add them in unsorted order List<BundleEntry> bundles = new ArrayList<>(Arrays.asList( newsBundle, socialBundle, recsBundle, promoBundle promoBundle, newsBundle, socialBundle, recsBundle )); Collections.sort(bundles, mSilentSectioner.getComparator()); assertEquals("i=0 expected Social", socialBundle, bundles.get(0)); assertEquals("i=1 expected Promo", promoBundle, bundles.get(1)); assertEquals("i=2 expected News", newsBundle, bundles.get(2)); assertEquals("i=3 expected Recs", recsBundle, bundles.get(3)); assertEquals("i=1 expected News", newsBundle, bundles.get(1)); assertEquals("i=2 expected Recs", recsBundle, bundles.get(2)); assertEquals("i=3 expected Promo", promoBundle, bundles.get(3)); } @Test Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinator.java +3 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,9 @@ public class RankingCoordinator implements Coordinator { private static final Map<String, Integer> BUNDLE_KEY_SORT_ORDER = new HashMap<>(); static { BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.SOCIAL_MEDIA_ID, 1); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.PROMOTIONS_ID, 2); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.NEWS_ID, 3); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.RECS_ID, 4); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.NEWS_ID, 2); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.RECS_ID, 3); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.PROMOTIONS_ID, 4); BUNDLE_KEY_SORT_ORDER.put("debug_bundle", 99); } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -334,20 +334,20 @@ public class RankingCoordinatorTest extends SysuiTestCase { public void testSilentSectionComparator_sortsBundlesByPrefixedKeys() { // This is the sorted order BundleEntry socialBundle = new BundleEntry(BundleSpec.Companion.getSOCIAL_MEDIA()); BundleEntry promoBundle = new BundleEntry(BundleSpec.Companion.getPROMOTIONS()); BundleEntry newsBundle = new BundleEntry(BundleSpec.Companion.getNEWS()); BundleEntry recsBundle = new BundleEntry(BundleSpec.Companion.getRECOMMENDED()); BundleEntry promoBundle = new BundleEntry(BundleSpec.Companion.getPROMOTIONS()); // Add them in unsorted order List<BundleEntry> bundles = new ArrayList<>(Arrays.asList( newsBundle, socialBundle, recsBundle, promoBundle promoBundle, newsBundle, socialBundle, recsBundle )); Collections.sort(bundles, mSilentSectioner.getComparator()); assertEquals("i=0 expected Social", socialBundle, bundles.get(0)); assertEquals("i=1 expected Promo", promoBundle, bundles.get(1)); assertEquals("i=2 expected News", newsBundle, bundles.get(2)); assertEquals("i=3 expected Recs", recsBundle, bundles.get(3)); assertEquals("i=1 expected News", newsBundle, bundles.get(1)); assertEquals("i=2 expected Recs", recsBundle, bundles.get(2)); assertEquals("i=3 expected Promo", promoBundle, bundles.get(3)); } @Test Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinator.java +3 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,9 @@ public class RankingCoordinator implements Coordinator { private static final Map<String, Integer> BUNDLE_KEY_SORT_ORDER = new HashMap<>(); static { BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.SOCIAL_MEDIA_ID, 1); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.PROMOTIONS_ID, 2); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.NEWS_ID, 3); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.RECS_ID, 4); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.NEWS_ID, 2); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.RECS_ID, 3); BUNDLE_KEY_SORT_ORDER.put(NotificationChannel.PROMOTIONS_ID, 4); BUNDLE_KEY_SORT_ORDER.put("debug_bundle", 99); } Loading