From 1e93f2a840e520a534888ce51353f5dc75677d39 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Fri, 11 Jun 2021 17:29:51 -0500 Subject: [PATCH] Hide footer for empty shade even if bubbles are present Bubbles are counted as active notifications even if its shade notif is hidden so we need to explicitly hide the footer when showing EmptyShadeView. Fixes: 186037856 Test: have empty shade and bubble => footer hidden Change-Id: Ia5798b9b3bd3f50a9028374941a8dd437365fcca --- .../notification/stack/NotificationStackScrollLayout.java | 1 + .../notification/stack/NotificationStackScrollLayoutTest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 8277fae64a628..ac2fd3b211f31 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -609,6 +609,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mController.hasActiveClearableNotifications(ROWS_ALL); RemoteInputController remoteInputController = mRemoteInputManager.getController(); boolean showFooterView = (showDismissView || mController.hasActiveNotifications()) + && mEmptyShadeView.getVisibility() == GONE && mStatusBarState != StatusBarState.KEYGUARD && !mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying() && (remoteInputController == null || !remoteInputController.isRemoteInputActive()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index 43f7284e477eb..04d7b7261ba72 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.stack; import static android.provider.Settings.Secure.NOTIFICATION_HISTORY_ENABLED; +import static android.view.View.GONE; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_ALL; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_GENTLE; @@ -316,6 +317,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { public void testUpdateFooter_oneClearableNotification() { setBarStateForTest(StatusBarState.SHADE); + when(mEmptyShadeView.getVisibility()).thenReturn(GONE); when(mStackScrollLayoutController.hasActiveClearableNotifications(ROWS_ALL)) .thenReturn(true); when(mStackScrollLayoutController.hasActiveNotifications()).thenReturn(true); @@ -337,6 +339,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { when(mStackScrollLayoutController.hasActiveNotifications()).thenReturn(true); when(mStackScrollLayoutController.hasActiveClearableNotifications(ROWS_ALL)) .thenReturn(false); + when(mEmptyShadeView.getVisibility()).thenReturn(GONE); FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view);