• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 com.android.systemui.log.table.TableLogBuffer
23 import javax.inject.Inject
24 import kotlinx.coroutines.flow.Flow
25 import kotlinx.coroutines.flow.MutableStateFlow
26 import kotlinx.coroutines.flow.StateFlow
27 import kotlinx.coroutines.flow.emptyFlow
28 import kotlinx.coroutines.flow.flowOf
29 
30 /**
31  * Implementation of the interactor that noops all face auth operations.
32  *
33  * This is required for SystemUI variants that do not support face authentication but still inject
34  * other SysUI components that depend on [DeviceEntryFaceAuthInteractor]
35  */
36 @SysUISingleton
37 class NoopDeviceEntryFaceAuthInteractor @Inject constructor() : DeviceEntryFaceAuthInteractor {
38     override val authenticationStatus: Flow<FaceAuthenticationStatus> = emptyFlow()
39     override val detectionStatus: Flow<FaceDetectionStatus> = emptyFlow()
40     override val isLockedOut: StateFlow<Boolean> = MutableStateFlow(false)
41     override val isAuthenticated: StateFlow<Boolean> = MutableStateFlow(false)
42     override val isBypassEnabled: Flow<Boolean> = flowOf(false)
43 
canFaceAuthRunnull44     override fun canFaceAuthRun(): Boolean = false
45 
46     override fun isRunning(): Boolean = false
47 
48     override fun isFaceAuthEnabledAndEnrolled(): Boolean = false
49 
50     override fun isFaceAuthStrong(): Boolean = false
51 
52     override fun start() = Unit
53 
54     override fun registerListener(listener: FaceAuthenticationListener) {}
55 
unregisterListenernull56     override fun unregisterListener(listener: FaceAuthenticationListener) {}
57 
onUdfpsSensorTouchednull58     override fun onUdfpsSensorTouched() {}
59 
onAssistantTriggeredOnLockScreennull60     override fun onAssistantTriggeredOnLockScreen() {}
61 
onDeviceLiftednull62     override fun onDeviceLifted() {}
63 
onShadeExpansionStartednull64     override fun onShadeExpansionStarted() {}
65 
onNotificationPanelClickednull66     override fun onNotificationPanelClicked() {}
67 
onSwipeUpOnBouncernull68     override fun onSwipeUpOnBouncer() {}
69 
onPrimaryBouncerUserInputnull70     override fun onPrimaryBouncerUserInput() {}
71 
onAccessibilityActionnull72     override fun onAccessibilityAction() {}
73 
onWalletLaunchednull74     override fun onWalletLaunched() = Unit
75 
76     override fun onDeviceUnfolded() {}
77 
hydrateTableLogBuffernull78     override suspend fun hydrateTableLogBuffer(tableLogBuffer: TableLogBuffer) {}
79 }
80