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

Commit c7591d29 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Face auth bypass layout issues" into main

parents fe70c992 01b33a74
Loading
Loading
Loading
Loading
+8 −18
Original line number Diff line number Diff line
@@ -183,17 +183,6 @@ class KeyguardRootViewModelTest(flags: FlagsParameterization) : SysuiTestCase()
            assertThat(isVisible?.isAnimating).isFalse()
        }

    @Test
    fun iconContainer_isVisible_bypassEnabled() =
        testScope.runTest {
            val isVisible by collectLastValue(underTest.isNotifIconContainerVisible)
            runCurrent()
            deviceEntryRepository.setBypassEnabled(true)
            runCurrent()

            assertThat(isVisible?.value).isTrue()
        }

    @Test
    fun iconContainer_isNotVisible_pulseExpanding_notBypassing() =
        testScope.runTest {
@@ -283,22 +272,23 @@ class KeyguardRootViewModelTest(flags: FlagsParameterization) : SysuiTestCase()
        }

    @Test
    fun iconContainer_isNotVisible_bypassDisabled_onLockscreen() =
    fun iconContainer_isNotVisible_notifsFullyHiddenThenVisible_bypassEnabled() =
        testScope.runTest {
            val isVisible by collectLastValue(underTest.isNotifIconContainerVisible)
            runCurrent()
            keyguardTransitionRepository.sendTransitionSteps(
                from = KeyguardState.AOD,
                to = KeyguardState.LOCKSCREEN,
                testScope,
            )
            notificationsKeyguardInteractor.setPulseExpanding(false)
            deviceEntryRepository.setBypassEnabled(false)
            deviceEntryRepository.setBypassEnabled(true)
            whenever(dozeParameters.alwaysOn).thenReturn(true)
            whenever(dozeParameters.displayNeedsBlanking).thenReturn(false)
            notificationsKeyguardInteractor.setNotificationsFullyHidden(true)
            runCurrent()

            assertThat(isVisible?.value).isTrue()
            assertThat(isVisible?.isAnimating).isTrue()

            notificationsKeyguardInteractor.setNotificationsFullyHidden(false)
            runCurrent()

            assertThat(isVisible?.value).isFalse()
            assertThat(isVisible?.isAnimating).isTrue()
        }
+0 −4
Original line number Diff line number Diff line
@@ -347,12 +347,8 @@ constructor(
                            when {
                                // If there are no notification icons to show, then it can be hidden
                                !hasAodIcons -> false
                                // If we're bypassing, then we're visible
                                isBypassEnabled -> true
                                // If we are pulsing (and not bypassing), then we are hidden
                                isPulseExpanding -> false
                                // Besides bypass above, they should not be visible on lockscreen
                                isOnLockscreen -> false
                                // If notifs are fully gone, then we're visible
                                areNotifsFullyHidden -> true
                                // Otherwise, we're hidden
+5 −0
Original line number Diff line number Diff line
@@ -2728,6 +2728,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    }

    private int calculatePanelHeightShade() {
        // Bypass should always occupy the full height
        if (mBarState == KEYGUARD && mKeyguardBypassController.getBypassEnabled()) {
            return mNotificationStackScrollLayoutController.getHeight();
        }

        int emptyBottomMargin = mNotificationStackScrollLayoutController.getEmptyBottomMargin();
        int maxHeight = mNotificationStackScrollLayoutController.getHeight() - emptyBottomMargin;