Merge "Remove section headers for non-silent notifications" into sc-dev

This commit is contained in:
Lyn Han
2021-03-11 19:57:33 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 57 deletions

View File

@@ -318,9 +318,6 @@ class NotificationSectionsManager @Inject internal constructor(
(child == null || row != null && nextBucket != row.entry.bucket) (child == null || row != null && nextBucket != row.entry.bucket)
if (isSectionBoundary && showHeaders) { if (isSectionBoundary && showHeaders) {
when (nextBucket) { when (nextBucket) {
BUCKET_HEADS_UP -> incomingState?.targetPosition = i + 1
BUCKET_PEOPLE -> peopleState?.targetPosition = i + 1
BUCKET_ALERTING -> alertingState?.targetPosition = i + 1
BUCKET_SILENT -> gentleState?.targetPosition = i + 1 BUCKET_SILENT -> gentleState?.targetPosition = i + 1
} }
} }

View File

@@ -322,23 +322,7 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
} }
@Test @Test
public void testPeopleFiltering_addHeadersFromShowingOnlyGentle() { public void testPeopleFiltering_onlyAddSilentHeader() {
enablePeopleFiltering();
setStackState(
GENTLE_HEADER,
PERSON,
ALERTING,
GENTLE);
mSectionsManager.updateSectionBoundaries();
verify(mNssl).changeViewPosition(mSectionsManager.getSilentHeaderView(), 2);
verify(mNssl).addView(mSectionsManager.getAlertingHeaderView(), 1);
verify(mNssl).addView(mSectionsManager.getPeopleHeaderView(), 0);
}
@Test
public void testPeopleFiltering_addAllHeaders() {
enablePeopleFiltering(); enablePeopleFiltering();
setStackState( setStackState(
@@ -348,26 +332,6 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verify(mNssl).addView(mSectionsManager.getSilentHeaderView(), 2); verify(mNssl).addView(mSectionsManager.getSilentHeaderView(), 2);
verify(mNssl).addView(mSectionsManager.getAlertingHeaderView(), 1);
verify(mNssl).addView(mSectionsManager.getPeopleHeaderView(), 0);
}
@Test
public void testPeopleFiltering_moveAllHeaders() {
enablePeopleFiltering();
setStackState(
PEOPLE_HEADER,
ALERTING_HEADER,
GENTLE_HEADER,
PERSON,
ALERTING,
GENTLE);
mSectionsManager.updateSectionBoundaries();
verify(mNssl).changeViewPosition(mSectionsManager.getSilentHeaderView(), 4);
verify(mNssl).changeViewPosition(mSectionsManager.getAlertingHeaderView(), 2);
verify(mNssl).changeViewPosition(mSectionsManager.getPeopleHeaderView(), 0);
} }
@Test @Test
@@ -385,9 +349,7 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.INCOMING_HEADER,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.PEOPLE_HEADER,
ChildType.PERSON, ChildType.PERSON,
ChildType.GENTLE_HEADER, ChildType.GENTLE_HEADER,
ChildType.GENTLE ChildType.GENTLE
@@ -408,10 +370,8 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.INCOMING_HEADER,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.PEOPLE_HEADER,
ChildType.PERSON ChildType.PERSON
); );
} }
@@ -428,7 +388,6 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.PEOPLE_HEADER,
ChildType.PERSON, ChildType.PERSON,
ChildType.PERSON ChildType.PERSON
); );
@@ -444,9 +403,7 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
); );
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.INCOMING_HEADER,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.PEOPLE_HEADER,
ChildType.PERSON ChildType.PERSON
); );
} }
@@ -467,12 +424,9 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.INCOMING_HEADER,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.FSN, ChildType.FSN,
ChildType.PEOPLE_HEADER,
ChildType.PERSON, ChildType.PERSON,
ChildType.ALERTING_HEADER,
ChildType.ALERTING, ChildType.ALERTING,
ChildType.GENTLE_HEADER, ChildType.GENTLE_HEADER,
ChildType.GENTLE ChildType.GENTLE
@@ -517,7 +471,7 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
} }
@Test @Test
public void testRemoveIncomingHeader() { public void testRemoveNonSilentHeader() {
enablePeopleFiltering(); enablePeopleFiltering();
enableMediaControls(); enableMediaControls();
@@ -539,9 +493,7 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
verifyMockStack( verifyMockStack(
ChildType.MEDIA_CONTROLS, ChildType.MEDIA_CONTROLS,
ChildType.PEOPLE_HEADER,
ChildType.PERSON, ChildType.PERSON,
ChildType.ALERTING_HEADER,
ChildType.ALERTING, ChildType.ALERTING,
ChildType.ALERTING, ChildType.ALERTING,
ChildType.ALERTING, ChildType.ALERTING,
@@ -569,13 +521,10 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.INCOMING_HEADER,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.HEADS_UP, ChildType.HEADS_UP,
ChildType.PEOPLE_HEADER,
ChildType.PERSON, ChildType.PERSON,
ChildType.ALERTING_HEADER,
ChildType.ALERTING ChildType.ALERTING
); );
} }
@@ -593,7 +542,6 @@ public class NotificationSectionsManagerTest extends SysuiTestCase {
mSectionsManager.updateSectionBoundaries(); mSectionsManager.updateSectionBoundaries();
verifyMockStack( verifyMockStack(
ChildType.ALERTING_HEADER,
ChildType.PERSON, ChildType.PERSON,
ChildType.ALERTING, ChildType.ALERTING,
ChildType.GENTLE_HEADER, ChildType.GENTLE_HEADER,