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

Commit 3dd873f5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Inline the notifications_pinned_hun_in_shade flag" into main

parents 009997c0 5fc45375
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -150,16 +150,6 @@ flag {
   }
}

flag {
    name: "notifications_pinned_hun_in_shade"
    namespace: "systemui"
    description: "Fixes displaying pinned HUNs in the Shade, making sure that their y and z positions are correct."
    bug: "385041854"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "notifications_hun_accessibility_refactor"
    namespace: "systemui"
+1 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import static android.view.accessibility.AccessibilityEvent.CONTENT_CHANGE_TYPE_
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;

import static com.android.systemui.Flags.notificationRowTransparency;
import static com.android.systemui.Flags.notificationsPinnedHunInShade;
import static com.android.systemui.flags.Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE;
import static com.android.systemui.statusbar.NotificationLockscreenUserManager.REDACTION_TYPE_NONE;
import static com.android.systemui.statusbar.notification.NotificationUtils.logKey;
@@ -3676,7 +3675,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        // Must stay on screen in the open shade regardless how much the stack is scrolled if:
        // 1. Is HUN and not marked as seen yet (isHeadsUp && mustStayOnScreen)
        // 2. Is an FSI HUN (isPinned)
        return mIsHeadsUp && mMustStayOnScreen || notificationsPinnedHunInShade() && isPinned();
        return mIsHeadsUp && mMustStayOnScreen || isPinned();
    }

    /**
+0 −19
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;

import android.app.Notification;
@@ -1113,14 +1112,12 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
    }

    @Test
    @EnableFlags(com.android.systemui.Flags.FLAG_NOTIFICATIONS_PINNED_HUN_IN_SHADE)
    public void mustStayOnScreen_false() throws Exception {
        final ExpandableNotificationRow row = mKosmos.createRow();
        assertThat(row.mustStayOnScreen()).isFalse();
    }

    @Test
    @EnableFlags(com.android.systemui.Flags.FLAG_NOTIFICATIONS_PINNED_HUN_IN_SHADE)
    public void mustStayOnScreen_isHeadsUp_markedAsSeen() throws Exception {
        final ExpandableNotificationRow row = mKosmos.createRow();
        // When the row is a HUN
@@ -1134,7 +1131,6 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
    }

    @Test
    @EnableFlags(com.android.systemui.Flags.FLAG_NOTIFICATIONS_PINNED_HUN_IN_SHADE)
    public void mustStayOnScreen_isPinned_markedAsSeen() throws Exception {
        final ExpandableNotificationRow row = mKosmos.createRow();
        // When a HUN is pinned
@@ -1148,21 +1144,6 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
        assertThat(row.mustStayOnScreen()).isTrue();
    }

    @Test
    @DisableFlags(com.android.systemui.Flags.FLAG_NOTIFICATIONS_PINNED_HUN_IN_SHADE)
    public void mustStayOnScreen_isPinned_markedAsSeen_false() throws Exception {
        final ExpandableNotificationRow row = mKosmos.createRow();
        // When a HUN is pinned
        row.setHeadsUp(true);
        row.setPinnedStatus(PinnedStatus.PinnedBySystem);
        //Then it must stay on screen
        assertThat(row.mustStayOnScreen()).isTrue();
        // And when the user has seen it
        row.markHeadsUpSeen();
        // Then it should NOT stay on screen anymore
        assertThat(row.mustStayOnScreen()).isFalse();
    }

    @Test
    @DisableFlags(PromotedNotificationUi.FLAG_NAME)
    public void hasStatusBarChipDuringHeadsUpAnimation_flagOff_false() throws Exception {