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

Commit ceb9d272 authored by Vincent Wang's avatar Vincent Wang Committed by Automerger Merge Worker
Browse files

Merge "Fix Biometric prompt is getting dismissed while receiving the heads-up...

Merge "Fix Biometric prompt is getting dismissed while receiving the heads-up notification" into udc-dev am: 5a0eb9c2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22570197



Change-Id: Id1d841e9f38890ed8149d1afc54acc5185a50545
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c530ebed 5a0eb9c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ constructor(
    private fun onPanelExpansionChanged(event: ShadeExpansionChangeEvent) =
        mainExecutor.execute {
            action?.let {
                if (event.tracking || event.expanded) {
                if (event.tracking || (event.expanded && event.fraction > 0)) {
                    Log.v(TAG, "Detected panel interaction, event: $event")
                    it.onPanelInteraction.run()
                    disable()
+12 −7
Original line number Diff line number Diff line
@@ -51,32 +51,37 @@ class AuthDialogPanelInteractionDetectorTest : SysuiTestCase() {
    @Test
    fun testEnableDetector_expandWithTrack_shouldPostRunnable() {
        detector.enable(action)
        // simulate notification expand
        shadeExpansionStateManager.onPanelExpansionChanged(5566f, true, true, 5566f)
        shadeExpansionStateManager.onPanelExpansionChanged(1.0f, true, true, 0f)
        verify(action).run()
    }

    @Test
    fun testEnableDetector_trackOnly_shouldPostRunnable() {
        detector.enable(action)
        // simulate notification expand
        shadeExpansionStateManager.onPanelExpansionChanged(5566f, false, true, 5566f)
        shadeExpansionStateManager.onPanelExpansionChanged(1.0f, false, true, 0f)
        verify(action).run()
    }

    @Test
    fun testEnableDetector_expandOnly_shouldPostRunnable() {
        detector.enable(action)
        // simulate notification expand
        shadeExpansionStateManager.onPanelExpansionChanged(5566f, true, false, 5566f)
        shadeExpansionStateManager.onPanelExpansionChanged(1.0f, true, false, 0f)
        verify(action).run()
    }

    @Test
    fun testEnableDetector_expandWithoutFraction_shouldPostRunnable() {
        detector.enable(action)
        // simulate headsup notification
        shadeExpansionStateManager.onPanelExpansionChanged(0.0f, true, false, 0f)
        verifyZeroInteractions(action)
    }

    @Test
    fun testEnableDetector_shouldNotPostRunnable() {
        detector.enable(action)
        detector.disable()
        shadeExpansionStateManager.onPanelExpansionChanged(5566f, true, true, 5566f)
        shadeExpansionStateManager.onPanelExpansionChanged(1.0f, true, true, 0f)
        verifyZeroInteractions(action)
    }
}