summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt6
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt
index 78ae8b119c69..c01c79dd2601 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt
@@ -574,7 +574,7 @@ class KeyguardRepositoryImplTest : SysuiTestCase() {
@Test
fun isEncryptedOrLockdown() =
- testScope.runTest {
+ TestScope(mainDispatcher).runTest {
whenever(userTracker.userId).thenReturn(0)
whenever(keyguardUpdateMonitor.isEncryptedOrLockdown(0)).thenReturn(true)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt
index 1c6056c3b9d0..64e28700aa74 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt
@@ -567,17 +567,17 @@ constructor(
val callback =
object : KeyguardUpdateMonitorCallback() {
override fun onStrongAuthStateChanged(userId: Int) {
- trySend(userId)
+ trySendWithFailureLogging(userId, TAG, "strong auth state change")
}
}
-
keyguardUpdateMonitor.registerCallback(callback)
-
awaitClose { keyguardUpdateMonitor.removeCallback(callback) }
}
.filter { userId -> userId == userTracker.userId }
.onStart { emit(userTracker.userId) }
.mapLatest { userId -> keyguardUpdateMonitor.isEncryptedOrLockdown(userId) }
+ // KeyguardUpdateMonitor#registerCallback needs to be called on the main thread.
+ .flowOn(mainDispatcher)
override fun isKeyguardShowing(): Boolean {
return keyguardStateController.isShowing