Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java +13 −3 Original line number Original line Diff line number Diff line Loading @@ -316,7 +316,7 @@ public class NotificationChildrenContainer extends ViewGroup { mNotificationHeaderWrapper.notifyContentUpdated(mContainingNotification); mNotificationHeaderWrapper.notifyContentUpdated(mContainingNotification); recreateLowPriorityHeader(builder); recreateLowPriorityHeader(builder); recreateAmbientHeader(builder); recreateAmbientHeader(builder); resetHeaderVisibilityIfNeeded(mNotificationHeader, calculateDesiredHeader()); updateHeaderVisibility(false /* animate */); updateChildrenHeaderAppearance(); updateChildrenHeaderAppearance(); } } Loading Loading @@ -854,6 +854,11 @@ public class NotificationChildrenContainer extends ViewGroup { return mNotificationHeaderLowPriority; return mNotificationHeaderLowPriority; } } @VisibleForTesting public ViewGroup getCurrentHeaderView() { return mCurrentHeader; } public void notifyShowAmbientChanged() { public void notifyShowAmbientChanged() { updateHeaderVisibility(false); updateHeaderVisibility(false); } } Loading Loading @@ -890,7 +895,12 @@ public class NotificationChildrenContainer extends ViewGroup { desiredHeader.setVisibility(VISIBLE); desiredHeader.setVisibility(VISIBLE); } } if (currentHeader != null) { if (currentHeader != null) { getWrapperForView(currentHeader).setVisible(false); // Wrapper can be null if we were a low priority notification // and just destroyed it by calling setIsLowPriority(false) NotificationViewWrapper wrapper = getWrapperForView(currentHeader); if (wrapper != null) { wrapper.setVisible(false); } currentHeader.setVisibility(INVISIBLE); currentHeader.setVisibility(INVISIBLE); } } } } Loading @@ -899,7 +909,7 @@ public class NotificationChildrenContainer extends ViewGroup { resetHeaderVisibilityIfNeeded(mNotificationHeaderAmbient, desiredHeader); resetHeaderVisibilityIfNeeded(mNotificationHeaderAmbient, desiredHeader); resetHeaderVisibilityIfNeeded(mNotificationHeaderLowPriority, desiredHeader); resetHeaderVisibilityIfNeeded(mNotificationHeaderLowPriority, desiredHeader); mCurrentHeader = currentHeader; mCurrentHeader = desiredHeader; } } private void resetHeaderVisibilityIfNeeded(View header, View desiredHeader) { private void resetHeaderVisibilityIfNeeded(View header, View desiredHeader) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -61,4 +61,12 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { Assert.assertTrue(lowPriorityHeaderView.getParent() == null); Assert.assertTrue(lowPriorityHeaderView.getParent() == null); Assert.assertTrue(childrenContainer.getLowPriorityHeaderView() == null); Assert.assertTrue(childrenContainer.getLowPriorityHeaderView() == null); } } @Test public void testRecreateNotificationHeader_hasHeader() { NotificationChildrenContainer childrenContainer = mGroup.getChildrenContainer(); childrenContainer.recreateNotificationHeader(null); Assert.assertNotNull("Children container must have a header after recreation", childrenContainer.getCurrentHeaderView()); } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java +13 −3 Original line number Original line Diff line number Diff line Loading @@ -316,7 +316,7 @@ public class NotificationChildrenContainer extends ViewGroup { mNotificationHeaderWrapper.notifyContentUpdated(mContainingNotification); mNotificationHeaderWrapper.notifyContentUpdated(mContainingNotification); recreateLowPriorityHeader(builder); recreateLowPriorityHeader(builder); recreateAmbientHeader(builder); recreateAmbientHeader(builder); resetHeaderVisibilityIfNeeded(mNotificationHeader, calculateDesiredHeader()); updateHeaderVisibility(false /* animate */); updateChildrenHeaderAppearance(); updateChildrenHeaderAppearance(); } } Loading Loading @@ -854,6 +854,11 @@ public class NotificationChildrenContainer extends ViewGroup { return mNotificationHeaderLowPriority; return mNotificationHeaderLowPriority; } } @VisibleForTesting public ViewGroup getCurrentHeaderView() { return mCurrentHeader; } public void notifyShowAmbientChanged() { public void notifyShowAmbientChanged() { updateHeaderVisibility(false); updateHeaderVisibility(false); } } Loading Loading @@ -890,7 +895,12 @@ public class NotificationChildrenContainer extends ViewGroup { desiredHeader.setVisibility(VISIBLE); desiredHeader.setVisibility(VISIBLE); } } if (currentHeader != null) { if (currentHeader != null) { getWrapperForView(currentHeader).setVisible(false); // Wrapper can be null if we were a low priority notification // and just destroyed it by calling setIsLowPriority(false) NotificationViewWrapper wrapper = getWrapperForView(currentHeader); if (wrapper != null) { wrapper.setVisible(false); } currentHeader.setVisibility(INVISIBLE); currentHeader.setVisibility(INVISIBLE); } } } } Loading @@ -899,7 +909,7 @@ public class NotificationChildrenContainer extends ViewGroup { resetHeaderVisibilityIfNeeded(mNotificationHeaderAmbient, desiredHeader); resetHeaderVisibilityIfNeeded(mNotificationHeaderAmbient, desiredHeader); resetHeaderVisibilityIfNeeded(mNotificationHeaderLowPriority, desiredHeader); resetHeaderVisibilityIfNeeded(mNotificationHeaderLowPriority, desiredHeader); mCurrentHeader = currentHeader; mCurrentHeader = desiredHeader; } } private void resetHeaderVisibilityIfNeeded(View header, View desiredHeader) { private void resetHeaderVisibilityIfNeeded(View header, View desiredHeader) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationChildrenContainerTest.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -61,4 +61,12 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { Assert.assertTrue(lowPriorityHeaderView.getParent() == null); Assert.assertTrue(lowPriorityHeaderView.getParent() == null); Assert.assertTrue(childrenContainer.getLowPriorityHeaderView() == null); Assert.assertTrue(childrenContainer.getLowPriorityHeaderView() == null); } } @Test public void testRecreateNotificationHeader_hasHeader() { NotificationChildrenContainer childrenContainer = mGroup.getChildrenContainer(); childrenContainer.recreateNotificationHeader(null); Assert.assertNotNull("Children container must have a header after recreation", childrenContainer.getCurrentHeaderView()); } } }