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

Commit f5c2cbbc authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge "Update a11y importance together with notifStats." into main

parents ac552084 74670ea1
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -4917,30 +4917,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    public void removeContainerView(View v) {
        Assert.isMainThread();
        removeView(v);
        if (!FooterViewRefactor.isEnabled()) {
            // A notification was removed, and we're not currently showing the empty shade view.
            if (v instanceof ExpandableNotificationRow && !mController.isShowingEmptyShadeView()) {
                mController.updateShowEmptyShadeView();
                updateFooter();
                mController.updateImportantForAccessibility();
            }
        }

        updateSpeedBumpIndex();
    }

    public void addContainerView(View v) {
        Assert.isMainThread();
        addView(v);
        if (!FooterViewRefactor.isEnabled()) {
            // A notification was added, and we're currently showing the empty shade view.
            if (v instanceof ExpandableNotificationRow && mController.isShowingEmptyShadeView()) {
                mController.updateShowEmptyShadeView();
                updateFooter();
                mController.updateImportantForAccessibility();
            }
        }

        updateSpeedBumpIndex();
    }

@@ -4948,14 +4930,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        Assert.isMainThread();
        ensureRemovedFromTransientContainer(v);
        addView(v, index);
        // A notification was added, and we're currently showing the empty shade view.
        if (!FooterViewRefactor.isEnabled() && v instanceof ExpandableNotificationRow
                && mController.isShowingEmptyShadeView()) {
            mController.updateShowEmptyShadeView();
            updateFooter();
            mController.updateImportantForAccessibility();
        }

        updateSpeedBumpIndex();
    }

+1 −0
Original line number Diff line number Diff line
@@ -2137,6 +2137,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {

            if (!FooterViewRefactor.isEnabled()) {
                updateShowEmptyShadeView();
                updateImportantForAccessibility();
            }
        }
    }
+0 −12
Original line number Diff line number Diff line
@@ -860,9 +860,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
        when(mNotificationStackScrollLayout.onKeyguard()).thenReturn(true);
        mController.getNotifStackController().setNotifStats(NotifStats.getEmpty());

        // WHEN: call updateImportantForAccessibility
        mController.updateImportantForAccessibility();

        // THEN: mNotificationStackScrollLayout should not be important for A11y
        verify(mNotificationStackScrollLayout)
                .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
@@ -884,9 +881,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
                        /* hasClearableSilentNotifs = */ false)
        );

        // WHEN: call updateImportantForAccessibility
        mController.updateImportantForAccessibility();

        // THEN: mNotificationStackScrollLayout should be important for A11y
        verify(mNotificationStackScrollLayout)
                .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
@@ -908,9 +902,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
                        /* hasClearableSilentNotifs = */ false)
        );

        // WHEN: call updateImportantForAccessibility
        mController.updateImportantForAccessibility();

        // THEN: mNotificationStackScrollLayout should be important for A11y
        verify(mNotificationStackScrollLayout)
                .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
@@ -925,9 +916,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
        when(mNotificationStackScrollLayout.onKeyguard()).thenReturn(false);
        mController.getNotifStackController().setNotifStats(NotifStats.getEmpty());

        // WHEN: call updateImportantForAccessibility
        mController.updateImportantForAccessibility();

        // THEN: mNotificationStackScrollLayout should be important for A11y
        verify(mNotificationStackScrollLayout)
                .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);