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

Commit 01b33a74 authored by Matt Pietal's avatar Matt Pietal
Browse files

Face auth bypass layout issues

The notification shade height isn't stable on swipe up. Unsure
what regressed this but add a check for bypass only that ensures
a stable height as the user is swiping up. This matches other
checks in the same file. Along with this, the AOD icons in bypass
mode would also adjust while swiping. The existing code already
accounts for bypass so remove the extra checks.

Test: atest KeyguardRootViewModelTest
Flag: EXEMPT bugfix
Fixes: 370656534
Change-Id: I38b8f33bd714143891c27ff67e7b6c0c08226a51
parent 51502aac
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;