Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,10 @@ public class NotificationSectionsManager implements StackScrollAlgorithm.Section // Put it at the end of the list. peopleHeaderTarget = lastNotifIndex; } // Offset the target to account for the current position of the people header. if (currentPeopleHeaderIdx != -1 && currentPeopleHeaderIdx < peopleHeaderTarget) { peopleHeaderTarget--; } } // Add headers in reverse order to preserve indices Loading Loading @@ -459,6 +463,11 @@ public class NotificationSectionsManager implements StackScrollAlgorithm.Section return mPeopleHubView; } @VisibleForTesting void setPeopleHubVisible(boolean visible) { mPeopleHubVisible = visible; } private final ConfigurationListener mConfigurationListener = new ConfigurationListener() { @Override public void onLocaleListChanged() { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,24 @@ public class NotificationSectionsManagerTest extends SysuiTestCase { verify(mNssl).changeViewPosition(mSectionsManager.getPeopleHeaderView(), 0); } @Test public void testPeopleFiltering_keepPeopleHeaderWhenSectionEmpty() { mSectionsManager.setPeopleHubVisible(true); enablePeopleFiltering(); setStackState( ChildType.PEOPLE_HEADER, ChildType.ALERTING_HEADER, ChildType.ALERTING, ChildType.GENTLE_HEADER, ChildType.GENTLE ); mSectionsManager.updateSectionBoundaries(); verify(mNssl, never()).removeView(mSectionsManager.getPeopleHeaderView()); verify(mNssl).changeViewPosition(mSectionsManager.getPeopleHeaderView(), 0); } private void enablePeopleFiltering() { when(mSectionsFeatureManager.isFilteringEnabled()).thenReturn(true); when(mSectionsFeatureManager.getNumberOfBuckets()).thenReturn(4); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,10 @@ public class NotificationSectionsManager implements StackScrollAlgorithm.Section // Put it at the end of the list. peopleHeaderTarget = lastNotifIndex; } // Offset the target to account for the current position of the people header. if (currentPeopleHeaderIdx != -1 && currentPeopleHeaderIdx < peopleHeaderTarget) { peopleHeaderTarget--; } } // Add headers in reverse order to preserve indices Loading Loading @@ -459,6 +463,11 @@ public class NotificationSectionsManager implements StackScrollAlgorithm.Section return mPeopleHubView; } @VisibleForTesting void setPeopleHubVisible(boolean visible) { mPeopleHubVisible = visible; } private final ConfigurationListener mConfigurationListener = new ConfigurationListener() { @Override public void onLocaleListChanged() { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,24 @@ public class NotificationSectionsManagerTest extends SysuiTestCase { verify(mNssl).changeViewPosition(mSectionsManager.getPeopleHeaderView(), 0); } @Test public void testPeopleFiltering_keepPeopleHeaderWhenSectionEmpty() { mSectionsManager.setPeopleHubVisible(true); enablePeopleFiltering(); setStackState( ChildType.PEOPLE_HEADER, ChildType.ALERTING_HEADER, ChildType.ALERTING, ChildType.GENTLE_HEADER, ChildType.GENTLE ); mSectionsManager.updateSectionBoundaries(); verify(mNssl, never()).removeView(mSectionsManager.getPeopleHeaderView()); verify(mNssl).changeViewPosition(mSectionsManager.getPeopleHeaderView(), 0); } private void enablePeopleFiltering() { when(mSectionsFeatureManager.isFilteringEnabled()).thenReturn(true); when(mSectionsFeatureManager.getNumberOfBuckets()).thenReturn(4); Loading