1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.deviceentry.domain.interactor 18 19 import com.android.systemui.dagger.SysUISingleton 20 import com.android.systemui.deviceentry.shared.model.FaceAuthenticationStatus 21 import com.android.systemui.deviceentry.shared.model.FaceDetectionStatus 22 import javax.inject.Inject 23 import kotlinx.coroutines.flow.Flow 24 import kotlinx.coroutines.flow.MutableStateFlow 25 import kotlinx.coroutines.flow.StateFlow 26 import kotlinx.coroutines.flow.emptyFlow 27 import kotlinx.coroutines.flow.flowOf 28 29 /** 30 * Implementation of the interactor that noops all face auth operations. 31 * 32 * This is required for SystemUI variants that do not support face authentication but still inject 33 * other SysUI components that depend on [DeviceEntryFaceAuthInteractor] 34 */ 35 @SysUISingleton 36 class NoopDeviceEntryFaceAuthInteractor @Inject constructor() : DeviceEntryFaceAuthInteractor { 37 override val authenticationStatus: Flow<FaceAuthenticationStatus> = emptyFlow() 38 override val detectionStatus: Flow<FaceDetectionStatus> = emptyFlow() 39 override val isLockedOut: StateFlow<Boolean> = MutableStateFlow(false) 40 override val isAuthenticated: StateFlow<Boolean> = MutableStateFlow(false) 41 override val isBypassEnabled: Flow<Boolean> = flowOf(false) 42 canFaceAuthRunnull43 override fun canFaceAuthRun(): Boolean = false 44 45 override fun isRunning(): Boolean = false 46 47 override fun isFaceAuthEnabledAndEnrolled(): Boolean = false 48 49 override fun isFaceAuthStrong(): Boolean = false 50 override fun start() = Unit 51 52 override fun registerListener(listener: FaceAuthenticationListener) {} 53 unregisterListenernull54 override fun unregisterListener(listener: FaceAuthenticationListener) {} 55 onUdfpsSensorTouchednull56 override fun onUdfpsSensorTouched() {} 57 onAssistantTriggeredOnLockScreennull58 override fun onAssistantTriggeredOnLockScreen() {} 59 onDeviceLiftednull60 override fun onDeviceLifted() {} 61 onQsExpansionStarednull62 override fun onQsExpansionStared() {} 63 onNotificationPanelClickednull64 override fun onNotificationPanelClicked() {} 65 onSwipeUpOnBouncernull66 override fun onSwipeUpOnBouncer() {} onPrimaryBouncerUserInputnull67 override fun onPrimaryBouncerUserInput() {} onAccessibilityActionnull68 override fun onAccessibilityAction() {} onWalletLaunchednull69 override fun onWalletLaunched() = Unit 70 override fun onDeviceUnfolded() {} 71 } 72