Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/promoted/domain/interactor/AODPromotedNotificationsInteractorTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ class AODPromotedNotificationsInteractorTest : SysuiTestCase() { } private fun Kosmos.setKeyguardLocked(locked: Boolean) { fakeKeyguardRepository.setKeyguardDismissible(!locked) fakeKeyguardRepository.setHasTrust(!locked) } private fun Kosmos.setScreenSharingProtectionActive(active: Boolean) { Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +10 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,12 @@ interface KeyguardRepository { */ val isKeyguardDismissible: StateFlow<Boolean> /** * Whether device entry believes the device is trusted. This can be true or false when keyguard * has been dismissed depending on biometric and trust states. */ val hasTrust: StateFlow<Boolean> /** * Observable for the signal that keyguard is about to go away. * Loading Loading @@ -381,6 +387,9 @@ constructor( override val isKeyguardDismissible: MutableStateFlow<Boolean> = MutableStateFlow(keyguardStateController.isUnlocked) override val hasTrust: MutableStateFlow<Boolean> = MutableStateFlow(keyguardStateController.canDismissLockScreen()) @SuppressLint("SharedFlowCreation") override val isKeyguardGoingAway: MutableSharedFlow<Boolean> = MutableSharedFlow<Boolean>( Loading Loading @@ -588,6 +597,7 @@ constructor( } override fun onUnlockedChanged() { hasTrust.value = keyguardStateController.canDismissLockScreen() isKeyguardDismissible.value = keyguardStateController.isUnlocked } } Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +10 −1 Original line number Diff line number Diff line Loading @@ -232,9 +232,18 @@ constructor( @Deprecated("Use KeyguardTransitionInteractor + KeyguardState") val isKeyguardShowing: StateFlow<Boolean> = repository.isKeyguardShowing /** Whether the keyguard is dismissible or not. */ /** * Whether the keyguard is unlocked or not. This is always true when keyguard has been dismissed * or can be dismissed by a swipe. */ val isKeyguardDismissible: StateFlow<Boolean> = repository.isKeyguardDismissible /** * Whether device entry believes the device is trusted. This can be true or false when keyguard * has been dismissed depending on biometric and trust states. */ val hasTrust: StateFlow<Boolean> = repository.hasTrust /** Whether the keyguard is occluded (covered by an activity). */ @Deprecated("Use KeyguardTransitionInteractor + KeyguardState.OCCLUDED") val isKeyguardOccluded: StateFlow<Boolean> = repository.isKeyguardOccluded Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/domain/interactor/AODPromotedNotificationInteractor.kt +3 −3 Original line number Diff line number Diff line Loading @@ -47,11 +47,11 @@ constructor( */ private val canShowPrivateNotificationContent: Flow<Boolean> = combine( keyguardInteractor.isKeyguardDismissible, keyguardInteractor.hasTrust, sensitiveNotificationProtectionInteractor.isSensitiveStateActive, biometricUnlockInteractor.unlockState, ) { isKeyguardDismissible, isSensitive, biometricUnlockState -> isKeyguardDismissible && ) { hasTrust, isSensitive, biometricUnlockState -> hasTrust && !isSensitive && !BiometricUnlockMode.dismissesKeyguard(biometricUnlockState.mode) } Loading packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeKeyguardRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ class FakeKeyguardRepository @Inject constructor() : KeyguardRepository { private val _isKeyguardUnlocked = MutableStateFlow(false) override val isKeyguardDismissible: StateFlow<Boolean> = _isKeyguardUnlocked.asStateFlow() private val _hasTrust = MutableStateFlow(false) override val hasTrust: StateFlow<Boolean> = _hasTrust.asStateFlow() private val _isKeyguardOccluded = MutableStateFlow(false) override val isKeyguardOccluded: StateFlow<Boolean> = _isKeyguardOccluded Loading Loading @@ -167,6 +170,10 @@ class FakeKeyguardRepository @Inject constructor() : KeyguardRepository { _isKeyguardUnlocked.value = isUnlocked } fun setHasTrust(hasTrust: Boolean) { _hasTrust.value = hasTrust } override fun setIsDozing(isDozing: Boolean) { _isDozing.value = isDozing } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/promoted/domain/interactor/AODPromotedNotificationsInteractorTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ class AODPromotedNotificationsInteractorTest : SysuiTestCase() { } private fun Kosmos.setKeyguardLocked(locked: Boolean) { fakeKeyguardRepository.setKeyguardDismissible(!locked) fakeKeyguardRepository.setHasTrust(!locked) } private fun Kosmos.setScreenSharingProtectionActive(active: Boolean) { Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +10 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,12 @@ interface KeyguardRepository { */ val isKeyguardDismissible: StateFlow<Boolean> /** * Whether device entry believes the device is trusted. This can be true or false when keyguard * has been dismissed depending on biometric and trust states. */ val hasTrust: StateFlow<Boolean> /** * Observable for the signal that keyguard is about to go away. * Loading Loading @@ -381,6 +387,9 @@ constructor( override val isKeyguardDismissible: MutableStateFlow<Boolean> = MutableStateFlow(keyguardStateController.isUnlocked) override val hasTrust: MutableStateFlow<Boolean> = MutableStateFlow(keyguardStateController.canDismissLockScreen()) @SuppressLint("SharedFlowCreation") override val isKeyguardGoingAway: MutableSharedFlow<Boolean> = MutableSharedFlow<Boolean>( Loading Loading @@ -588,6 +597,7 @@ constructor( } override fun onUnlockedChanged() { hasTrust.value = keyguardStateController.canDismissLockScreen() isKeyguardDismissible.value = keyguardStateController.isUnlocked } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +10 −1 Original line number Diff line number Diff line Loading @@ -232,9 +232,18 @@ constructor( @Deprecated("Use KeyguardTransitionInteractor + KeyguardState") val isKeyguardShowing: StateFlow<Boolean> = repository.isKeyguardShowing /** Whether the keyguard is dismissible or not. */ /** * Whether the keyguard is unlocked or not. This is always true when keyguard has been dismissed * or can be dismissed by a swipe. */ val isKeyguardDismissible: StateFlow<Boolean> = repository.isKeyguardDismissible /** * Whether device entry believes the device is trusted. This can be true or false when keyguard * has been dismissed depending on biometric and trust states. */ val hasTrust: StateFlow<Boolean> = repository.hasTrust /** Whether the keyguard is occluded (covered by an activity). */ @Deprecated("Use KeyguardTransitionInteractor + KeyguardState.OCCLUDED") val isKeyguardOccluded: StateFlow<Boolean> = repository.isKeyguardOccluded Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/domain/interactor/AODPromotedNotificationInteractor.kt +3 −3 Original line number Diff line number Diff line Loading @@ -47,11 +47,11 @@ constructor( */ private val canShowPrivateNotificationContent: Flow<Boolean> = combine( keyguardInteractor.isKeyguardDismissible, keyguardInteractor.hasTrust, sensitiveNotificationProtectionInteractor.isSensitiveStateActive, biometricUnlockInteractor.unlockState, ) { isKeyguardDismissible, isSensitive, biometricUnlockState -> isKeyguardDismissible && ) { hasTrust, isSensitive, biometricUnlockState -> hasTrust && !isSensitive && !BiometricUnlockMode.dismissesKeyguard(biometricUnlockState.mode) } Loading
packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeKeyguardRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ class FakeKeyguardRepository @Inject constructor() : KeyguardRepository { private val _isKeyguardUnlocked = MutableStateFlow(false) override val isKeyguardDismissible: StateFlow<Boolean> = _isKeyguardUnlocked.asStateFlow() private val _hasTrust = MutableStateFlow(false) override val hasTrust: StateFlow<Boolean> = _hasTrust.asStateFlow() private val _isKeyguardOccluded = MutableStateFlow(false) override val isKeyguardOccluded: StateFlow<Boolean> = _isKeyguardOccluded Loading Loading @@ -167,6 +170,10 @@ class FakeKeyguardRepository @Inject constructor() : KeyguardRepository { _isKeyguardUnlocked.value = isUnlocked } fun setHasTrust(hasTrust: Boolean) { _hasTrust.value = hasTrust } override fun setIsDozing(isDozing: Boolean) { _isDozing.value = isDozing } Loading