Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49767edc authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Hiding clear all when replying now" into pi-dev

am: 7cf18d5e

Change-Id: Id933193e7e5ef4a834e1d67750fbccb5a68e2d6e
parents fe23be6c 7cf18d5e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1452,7 +1452,8 @@ public class StatusBar extends SystemUI implements DemoMode,
    @VisibleForTesting
    protected void updateFooter() {
        boolean showFooterView = mState != StatusBarState.KEYGUARD
                && mEntryManager.getNotificationData().getActiveNotifications().size() != 0;
                && mEntryManager.getNotificationData().getActiveNotifications().size() != 0
                && !mRemoteInputManager.getController().isRemoteInputActive();
        boolean showDismissView = mClearAllEnabled && mState != StatusBarState.KEYGUARD
                && hasActiveClearableNotifications();

@@ -2832,6 +2833,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                            boolean remoteInputActive) {
                        mHeadsUpManager.setRemoteInputActive(entry, remoteInputActive);
                        entry.row.notifyHeightChanged(true /* needsAnimation */);
                        updateFooter();
                    }
                    public void lockScrollTo(NotificationData.Entry entry) {
                        mStackScroller.lockScrollTo(entry.row);
+22 −1
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.ActivityLaunchAnimator;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
@@ -139,6 +140,8 @@ public class StatusBarTest extends SysuiTestCase {
    @Mock private NotificationListener mNotificationListener;
    @Mock private KeyguardViewMediator mKeyguardViewMediator;
    @Mock private NotificationLockscreenUserManager mLockscreenUserManager;
    @Mock private NotificationRemoteInputManager mRemoteInputManager;
    @Mock private RemoteInputController mRemoteInputController;

    private TestableStatusBar mStatusBar;
    private FakeMetricsLogger mMetricsLogger;
@@ -200,13 +203,14 @@ public class StatusBarTest extends SysuiTestCase {

        mEntryManager = new TestableNotificationEntryManager(mSystemServicesProxy, mPowerManager,
                mContext);
        when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);
        mStatusBar = new TestableStatusBar(mStatusBarKeyguardViewManager, mUnlockMethodCache,
                mKeyguardIndicationController, mStackScroller, mHeadsUpManager,
                mPowerManager, mNotificationPanelView, mBarService, mNotificationListener,
                mNotificationLogger, mVisualStabilityManager, mViewHierarchyManager,
                mEntryManager, mScrimController, mFingerprintUnlockController,
                mock(ActivityLaunchAnimator.class), mKeyguardViewMediator,
                mock(NotificationRemoteInputManager.class), mock(NotificationGroupManager.class),
                mRemoteInputManager, mock(NotificationGroupManager.class),
                mock(FalsingManager.class), mock(StatusBarWindowManager.class),
                mock(NotificationIconAreaController.class), mock(DozeScrimController.class),
                mock(NotificationShelf.class), mLockscreenUserManager,
@@ -587,6 +591,23 @@ public class StatusBarTest extends SysuiTestCase {
        verify(mStackScroller).updateFooterView(false, false);
    }

    @Test
    public void testUpdateFooter_remoteInput() {
        mStatusBar.setBarStateForTest(StatusBarState.SHADE);
        ArrayList<Entry> entries = new ArrayList<>();
        entries.add(mock(Entry.class));
        when(mNotificationData.getActiveNotifications()).thenReturn(entries);

        ExpandableNotificationRow row = mock(ExpandableNotificationRow.class);
        when(row.canViewBeDismissed()).thenReturn(true);
        when(mStackScroller.getChildCount()).thenReturn(1);
        when(mStackScroller.getChildAt(anyInt())).thenReturn(row);
        when(mRemoteInputController.isRemoteInputActive()).thenReturn(true);

        mStatusBar.updateFooter();
        verify(mStackScroller).updateFooterView(false, true);
    }

    @Test
    public void testUpdateFooter_oneClearableNotification() {
        mStatusBar.setBarStateForTest(StatusBarState.SHADE);