Loading packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java +4 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ public class EmptyShadeView extends StackScrollerDecorView { mEmptyText.setText(mText); } public int getTextResource() { return mText; } @Override protected void onFinishInflate() { super.onFinishInflate(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -784,6 +784,12 @@ public class StatusBar extends SystemUI implements DemoMode, // into fragments, but the rest here, it leaves some awkward lifecycle and whatnot. mNotificationPanel = mStatusBarWindow.findViewById(R.id.notification_panel); mStackScroller = mStatusBarWindow.findViewById(R.id.notification_stack_scroller); mZenController.addCallback(new ZenModeController.Callback() { @Override public void onZenChanged(int zen) { updateEmptyShadeView(); } }); mActivityLaunchAnimator = new ActivityLaunchAnimator(mStatusBarWindow, this, mNotificationPanel, Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +12 −4 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.function.BiConsumer; /** Loading Loading @@ -4039,14 +4040,21 @@ public class NotificationStackScrollLayout extends ViewGroup public void updateEmptyShadeView(boolean visible) { int oldVisibility = mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility(); int newVisibility = visible ? VISIBLE : GONE; if (oldVisibility != newVisibility) { boolean changedVisibility = oldVisibility != newVisibility; if (changedVisibility || newVisibility != GONE) { if (newVisibility != GONE) { int oldText = mEmptyShadeView.getTextResource(); int newText; if (mStatusBar.areNotificationsHidden()) { mEmptyShadeView.setText(R.string.dnd_suppressing_shade_text); newText = R.string.dnd_suppressing_shade_text; } else { mEmptyShadeView.setText(R.string.empty_shade_text); newText = R.string.empty_shade_text; } if (changedVisibility || !Objects.equals(oldText, newText)) { mEmptyShadeView.setText(newText); showFooterView(mEmptyShadeView); } } else { hideFooterView(mEmptyShadeView, true); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayoutTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,19 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mEmptyShadeView).setText(R.string.empty_shade_text); } @Test public void updateEmptyView_noNotificationsToDndSuppressing() { mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mEmptyShadeView.willBeGone()).thenReturn(true); when(mBar.areNotificationsHidden()).thenReturn(false); mStackScroller.updateEmptyShadeView(true); verify(mEmptyShadeView).setText(R.string.empty_shade_text); when(mBar.areNotificationsHidden()).thenReturn(true); mStackScroller.updateEmptyShadeView(true); verify(mEmptyShadeView).setText(R.string.dnd_suppressing_shade_text); } @Test @UiThreadTest public void testSetExpandedHeight_blockingHelperManagerReceivedCallbacks() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java +4 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ public class EmptyShadeView extends StackScrollerDecorView { mEmptyText.setText(mText); } public int getTextResource() { return mText; } @Override protected void onFinishInflate() { super.onFinishInflate(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -784,6 +784,12 @@ public class StatusBar extends SystemUI implements DemoMode, // into fragments, but the rest here, it leaves some awkward lifecycle and whatnot. mNotificationPanel = mStatusBarWindow.findViewById(R.id.notification_panel); mStackScroller = mStatusBarWindow.findViewById(R.id.notification_stack_scroller); mZenController.addCallback(new ZenModeController.Callback() { @Override public void onZenChanged(int zen) { updateEmptyShadeView(); } }); mActivityLaunchAnimator = new ActivityLaunchAnimator(mStatusBarWindow, this, mNotificationPanel, Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +12 −4 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.function.BiConsumer; /** Loading Loading @@ -4039,14 +4040,21 @@ public class NotificationStackScrollLayout extends ViewGroup public void updateEmptyShadeView(boolean visible) { int oldVisibility = mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility(); int newVisibility = visible ? VISIBLE : GONE; if (oldVisibility != newVisibility) { boolean changedVisibility = oldVisibility != newVisibility; if (changedVisibility || newVisibility != GONE) { if (newVisibility != GONE) { int oldText = mEmptyShadeView.getTextResource(); int newText; if (mStatusBar.areNotificationsHidden()) { mEmptyShadeView.setText(R.string.dnd_suppressing_shade_text); newText = R.string.dnd_suppressing_shade_text; } else { mEmptyShadeView.setText(R.string.empty_shade_text); newText = R.string.empty_shade_text; } if (changedVisibility || !Objects.equals(oldText, newText)) { mEmptyShadeView.setText(newText); showFooterView(mEmptyShadeView); } } else { hideFooterView(mEmptyShadeView, true); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayoutTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,19 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mEmptyShadeView).setText(R.string.empty_shade_text); } @Test public void updateEmptyView_noNotificationsToDndSuppressing() { mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mEmptyShadeView.willBeGone()).thenReturn(true); when(mBar.areNotificationsHidden()).thenReturn(false); mStackScroller.updateEmptyShadeView(true); verify(mEmptyShadeView).setText(R.string.empty_shade_text); when(mBar.areNotificationsHidden()).thenReturn(true); mStackScroller.updateEmptyShadeView(true); verify(mEmptyShadeView).setText(R.string.dnd_suppressing_shade_text); } @Test @UiThreadTest public void testSetExpandedHeight_blockingHelperManagerReceivedCallbacks() { Loading