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

Commit 65599805 authored by Shawn Lin's avatar Shawn Lin Committed by Android (Google) Code Review
Browse files

Merge "Fix not able to auth when notification is expanded" into udc-qpr-dev

parents f1f94bcd aa0e7c0b
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -37,4 +37,8 @@ class UdfpsBpViewController(
    dumpManager
    dumpManager
) {
) {
    override val tag = "UdfpsBpViewController"
    override val tag = "UdfpsBpViewController"

    override fun shouldPauseAuth(): Boolean {
        return false
    }
}
}
+68 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.biometrics

import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.RoboPilotTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeExpansionStateManager
import com.android.systemui.statusbar.phone.SystemUIDialogManager
import org.junit.Assert.assertFalse
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.junit.MockitoJUnit

@SmallTest
@RoboPilotTest
@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class UdfpsBpViewControllerTest : SysuiTestCase() {

    @JvmField @Rule var rule = MockitoJUnit.rule()

    @Mock lateinit var udfpsBpView: UdfpsBpView
    @Mock lateinit var statusBarStateController: StatusBarStateController
    @Mock lateinit var shadeExpansionStateManager: ShadeExpansionStateManager
    @Mock lateinit var systemUIDialogManager: SystemUIDialogManager
    @Mock lateinit var dumpManager: DumpManager

    private lateinit var udfpsBpViewController: UdfpsBpViewController

    @Before
    fun setup() {
        udfpsBpViewController =
            UdfpsBpViewController(
                udfpsBpView,
                statusBarStateController,
                shadeExpansionStateManager,
                systemUIDialogManager,
                dumpManager
            )
    }

    @Test
    fun testShouldNeverPauseAuth() {
        assertFalse(udfpsBpViewController.shouldPauseAuth())
    }
}