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

Commit a031ddd6 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge "Fix bug that heads up notification appear even when disable_expand is set" into pi-dev

parents 1ae7fd5f 30d3651f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1896,6 +1896,13 @@ public class StatusBar extends SystemUI implements DemoMode,
            }
        }

        if (!panelsEnabled()) {
            if (DEBUG) {
                Log.d(TAG, "No peeking: disabled panel : " + sbn.getKey());
            }
            return false;
        }

        if (sbn.getNotification().fullScreenIntent != null) {
            if (mAccessibilityManager.isTouchExplorationEnabled()) {
                if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey());
+24 −0
Original line number Diff line number Diff line
@@ -442,6 +442,30 @@ public class StatusBarTest extends SysuiTestCase {
        assertTrue(mEntryManager.shouldPeek(entry, sbn));
    }

    @Test
    public void testPeek_disabledStatusBar() {
        Notification n = new Notification.Builder(getContext(), "a").build();
        StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n,
                UserHandle.of(0), null, 0);
        NotificationData.Entry entry = new NotificationData.Entry(sbn);
        mStatusBar.disable(StatusBarManager.DISABLE_EXPAND, 0, false /* animate */);

        assertFalse("The panel shouldn't allow peek while disabled",
                mStatusBar.shouldPeek(entry, sbn));
    }

    @Test
    public void testPeek_disabledNotificationShade() {
        Notification n = new Notification.Builder(getContext(), "a").build();
        StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n,
                UserHandle.of(0), null, 0);
        NotificationData.Entry entry = new NotificationData.Entry(sbn);
        mStatusBar.disable(0, StatusBarManager.DISABLE2_NOTIFICATION_SHADE, false /* animate */);

        assertFalse("The panel shouldn't allow peek while notitifcation shade disabled",
                mStatusBar.shouldPeek(entry, sbn));
    }

    @Test
    public void testLogHidden() {
        try {