Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationRankingManager.kt +8 −9 Original line number Diff line number Diff line Loading @@ -78,12 +78,6 @@ open class NotificationRankingManager @Inject constructor( val aPersonType = a.getPeopleNotificationType() val bPersonType = b.getPeopleNotificationType() val aIsPeople = aPersonType == TYPE_PERSON val bIsPeople = bPersonType == TYPE_PERSON val aIsImportantPeople = aPersonType == TYPE_IMPORTANT_PERSON val bIsImportantPeople = bPersonType == TYPE_IMPORTANT_PERSON val aMedia = isImportantMedia(a) val bMedia = isImportantMedia(b) Loading @@ -100,9 +94,14 @@ open class NotificationRankingManager @Inject constructor( aHeadsUp != bHeadsUp -> if (aHeadsUp) -1 else 1 // Provide consistent ranking with headsUpManager aHeadsUp -> headsUpManager.compare(a, b) usePeopleFiltering && aIsPeople != bIsPeople -> if (aIsPeople) -1 else 1 usePeopleFiltering && aIsImportantPeople != bIsImportantPeople -> if (aIsImportantPeople) -1 else 1 usePeopleFiltering && aPersonType != bPersonType -> when (aPersonType) { TYPE_IMPORTANT_PERSON -> -1 TYPE_PERSON -> when (bPersonType) { TYPE_IMPORTANT_PERSON -> 1 else -> -1 } else -> 1 } // Upsort current media notification. aMedia != bMedia -> if (aMedia) -1 else 1 // Upsort PRIORITY_MAX system notifications Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationRankingManagerTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import com.android.systemui.statusbar.policy.HeadsUpManager import dagger.Lazy import junit.framework.Assert.assertEquals import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock Loading Loading @@ -194,7 +193,6 @@ class NotificationRankingManagerTest : SysuiTestCase() { assertEquals(listOf(b, a), rankingManager.updateRanking(null, listOf(a, b), "test")) } @Ignore // TODO: (b/149046729) fix test and re-enable @Test fun testSort_importantPeople() { whenever(sectionsManager.isFilteringEnabled()).thenReturn(true) Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationRankingManager.kt +8 −9 Original line number Diff line number Diff line Loading @@ -78,12 +78,6 @@ open class NotificationRankingManager @Inject constructor( val aPersonType = a.getPeopleNotificationType() val bPersonType = b.getPeopleNotificationType() val aIsPeople = aPersonType == TYPE_PERSON val bIsPeople = bPersonType == TYPE_PERSON val aIsImportantPeople = aPersonType == TYPE_IMPORTANT_PERSON val bIsImportantPeople = bPersonType == TYPE_IMPORTANT_PERSON val aMedia = isImportantMedia(a) val bMedia = isImportantMedia(b) Loading @@ -100,9 +94,14 @@ open class NotificationRankingManager @Inject constructor( aHeadsUp != bHeadsUp -> if (aHeadsUp) -1 else 1 // Provide consistent ranking with headsUpManager aHeadsUp -> headsUpManager.compare(a, b) usePeopleFiltering && aIsPeople != bIsPeople -> if (aIsPeople) -1 else 1 usePeopleFiltering && aIsImportantPeople != bIsImportantPeople -> if (aIsImportantPeople) -1 else 1 usePeopleFiltering && aPersonType != bPersonType -> when (aPersonType) { TYPE_IMPORTANT_PERSON -> -1 TYPE_PERSON -> when (bPersonType) { TYPE_IMPORTANT_PERSON -> 1 else -> -1 } else -> 1 } // Upsort current media notification. aMedia != bMedia -> if (aMedia) -1 else 1 // Upsort PRIORITY_MAX system notifications Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationRankingManagerTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import com.android.systemui.statusbar.policy.HeadsUpManager import dagger.Lazy import junit.framework.Assert.assertEquals import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock Loading Loading @@ -194,7 +193,6 @@ class NotificationRankingManagerTest : SysuiTestCase() { assertEquals(listOf(b, a), rankingManager.updateRanking(null, listOf(a, b), "test")) } @Ignore // TODO: (b/149046729) fix test and re-enable @Test fun testSort_importantPeople() { whenever(sectionsManager.isFilteringEnabled()).thenReturn(true) Loading