From cc59b9e6959c569ebd6c92305974d2debbff8cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Tue, 9 Aug 2022 12:57:59 +0200 Subject: [PATCH] Address review comments. --- .../features/pin/lockscreen/biometrics/BiometricHelperTests.kt | 3 ++- .../app/features/pin/lockscreen/ui/LockScreenViewModel.kt | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vector/src/androidTest/java/im/vector/app/features/pin/lockscreen/biometrics/BiometricHelperTests.kt b/vector/src/androidTest/java/im/vector/app/features/pin/lockscreen/biometrics/BiometricHelperTests.kt index 2ec69cf0b1..30520dd44f 100644 --- a/vector/src/androidTest/java/im/vector/app/features/pin/lockscreen/biometrics/BiometricHelperTests.kt +++ b/vector/src/androidTest/java/im/vector/app/features/pin/lockscreen/biometrics/BiometricHelperTests.kt @@ -39,6 +39,7 @@ import im.vector.app.features.pin.lockscreen.ui.fallbackprompt.FallbackBiometric import im.vector.app.features.pin.lockscreen.utils.DevicePromptCheck import io.mockk.clearAllMocks import io.mockk.every +import io.mockk.justRun import io.mockk.mockk import io.mockk.mockkObject import io.mockk.mockkStatic @@ -247,7 +248,7 @@ class BiometricHelperTests { every { createAuthChannel() } returns mockAuthChannel every { authenticateWithPromptInternal(any(), any(), any()) } returns mockk() } - every { lockScreenKeyRepository.deleteSystemKey() } returns Unit + justRun { lockScreenKeyRepository.deleteSystemKey() } val latch = CountDownLatch(1) val intent = Intent(InstrumentationRegistry.getInstrumentation().targetContext, LockScreenTestActivity::class.java) diff --git a/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenViewModel.kt b/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenViewModel.kt index 417ebdbd93..2230215047 100644 --- a/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/pin/lockscreen/ui/LockScreenViewModel.kt @@ -182,8 +182,7 @@ class LockScreenViewModel @AssistedInject constructor( * See issue [#6768](https://github.com/vector-im/element-android/issues/6768). */ @SuppressLint("NewApi") - @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) - internal suspend fun waitUntilKeyguardIsUnlocked() { + private suspend fun waitUntilKeyguardIsUnlocked() { if (versionProvider.get() < Build.VERSION_CODES.S) return withTimeoutOrNull(5.seconds) { while (keyguardManager.isDeviceLocked) {