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

Commit 4ad608b2 authored by Mady Mellor's avatar Mady Mellor Committed by Automerger Merge Worker
Browse files

Merge "Allow bubbles for HUNs that were "snoozed" via the gesture" into...

Merge "Allow bubbles for HUNs that were "snoozed" via the gesture" into rvc-dev am: 892d50ba am: 1b748835 am: c8f8dc94 am: 5a39dd94

Change-Id: Iaf58b3fcb3d4991502846f906cc4c973619bd8aa
parents e116c7d6 5a39dd94
Loading
Loading
Loading
Loading
+7 −8
Original line number Original line Diff line number Diff line
@@ -206,6 +206,13 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter
            return false;
            return false;
        }
        }


        if (isSnoozedPackage(sbn)) {
            if (DEBUG_HEADS_UP) {
                Log.d(TAG, "No alerting: snoozed package: " + sbn.getKey());
            }
            return false;
        }

        boolean inShade = mStatusBarStateController.getState() == SHADE;
        boolean inShade = mStatusBarStateController.getState() == SHADE;
        if (entry.isBubble() && inShade) {
        if (entry.isBubble() && inShade) {
            if (DEBUG_HEADS_UP) {
            if (DEBUG_HEADS_UP) {
@@ -365,14 +372,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter
                return false;
                return false;
            }
            }
        }
        }

        if (isSnoozedPackage(sbn)) {
            if (DEBUG_HEADS_UP) {
                Log.d(TAG, "No alerting: snoozed package: " + sbn.getKey());
            }
            return false;
        }

        return true;
        return true;
    }
    }


+1 −13
Original line number Original line Diff line number Diff line
@@ -115,15 +115,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
        when(mNotificationFilter.shouldFilterOut(any())).thenReturn(false);
        when(mNotificationFilter.shouldFilterOut(any())).thenReturn(false);
    }
    }


    /**
     * Sets up the state such that any requests to
     * {@link NotificationInterruptStateProviderImpl#canAlertAwakeCommon(NotificationEntry)} will
     * pass as long its provided NotificationEntry fulfills launch fullscreen check.
     */
    private void ensureStateForAlertAwakeCommon() {
        when(mHeadsUpManager.isSnoozed(any())).thenReturn(false);
    }

    /**
    /**
     * Sets up the state such that any requests to
     * Sets up the state such that any requests to
     * {@link NotificationInterruptStateProviderImpl#shouldHeadsUp(NotificationEntry)} will
     * {@link NotificationInterruptStateProviderImpl#shouldHeadsUp(NotificationEntry)} will
@@ -131,7 +122,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
     */
     */
    private void ensureStateForHeadsUpWhenAwake() throws RemoteException {
    private void ensureStateForHeadsUpWhenAwake() throws RemoteException {
        ensureStateForAlertCommon();
        ensureStateForAlertCommon();
        ensureStateForAlertAwakeCommon();
        when(mHeadsUpManager.isSnoozed(any())).thenReturn(false);


        when(mStatusBarStateController.isDozing()).thenReturn(false);
        when(mStatusBarStateController.isDozing()).thenReturn(false);
        when(mDreamManager.isDreaming()).thenReturn(false);
        when(mDreamManager.isDreaming()).thenReturn(false);
@@ -157,7 +148,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
     */
     */
    private void ensureStateForBubbleUp() {
    private void ensureStateForBubbleUp() {
        ensureStateForAlertCommon();
        ensureStateForAlertCommon();
        ensureStateForAlertAwakeCommon();
    }
    }


    @Test
    @Test
@@ -392,7 +382,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
    @Test
    @Test
    public void testShouldNotHeadsUp_snoozedPackage() {
    public void testShouldNotHeadsUp_snoozedPackage() {
        NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT);
        NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT);
        ensureStateForAlertAwakeCommon();


        when(mHeadsUpManager.isSnoozed(entry.getSbn().getPackageName())).thenReturn(true);
        when(mHeadsUpManager.isSnoozed(entry.getSbn().getPackageName())).thenReturn(true);


@@ -402,7 +391,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {


    @Test
    @Test
    public void testShouldNotHeadsUp_justLaunchedFullscreen() {
    public void testShouldNotHeadsUp_justLaunchedFullscreen() {
        ensureStateForAlertAwakeCommon();


        // On screen alerts don't happen when that package has just launched fullscreen.
        // On screen alerts don't happen when that package has just launched fullscreen.
        NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT);
        NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT);