Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading