Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −5 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_OPENED; import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_UNKNOWN; import android.annotation.AnyThread; import android.annotation.MainThread; Loading Loading @@ -1868,7 +1867,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @Override public void onPostureChanged(@DevicePostureInt int posture) { if (posture == DEVICE_POSTURE_OPENED) { mLogger.d("Posture changed to open - attempting to request active unlock"); mLogger.d("Posture changed to open - attempting to request active" + " unlock and run face auth"); getFaceAuthInteractor().onDeviceUnfolded(); requestActiveUnlockFromWakeReason(PowerManager.WAKE_REASON_UNFOLD_DEVICE, false); } Loading Loading @@ -2434,9 +2435,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab updateFingerprintListeningState(BIOMETRIC_ACTION_START); } }); if (mConfigFaceAuthSupportedPosture != DEVICE_POSTURE_UNKNOWN) { mDevicePostureController.addCallback(mPostureCallback); } updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE); mTaskStackChangeListeners.registerTaskStackListener(mTaskStackListener); Loading packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FacePropertyRepository.kt +12 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.shared.model.DevicePosture import com.android.systemui.res.R import java.util.concurrent.Executor import javax.inject.Inject Loading Loading @@ -68,6 +69,8 @@ interface FacePropertyRepository { /** The info of current available camera. */ val cameraInfo: StateFlow<CameraInfo?> val supportedPostures: List<DevicePosture> } /** Describes a biometric sensor */ Loading Loading @@ -188,6 +191,15 @@ constructor( initialValue = if (cameraInfoList.isNotEmpty()) cameraInfoList[0] else null ) private val supportedPosture = applicationContext.resources.getInteger(R.integer.config_face_auth_supported_posture) override val supportedPostures: List<DevicePosture> = if (supportedPosture == 0) { DevicePosture.entries } else { listOf(DevicePosture.toPosture(supportedPosture)) } private val defaultSensorLocation: StateFlow<Point?> = cameraInfo .map { it?.cameraLocation } Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ interface DeviceEntryFaceAuthInteractor { fun onPrimaryBouncerUserInput() fun onAccessibilityAction() fun onWalletLaunched() fun onDeviceUnfolded() /** Whether face auth is considered class 3 */ fun isFaceAuthStrong(): Boolean Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt +1 −0 Original line number Diff line number Diff line Loading @@ -66,4 +66,5 @@ class NoopDeviceEntryFaceAuthInteractor @Inject constructor() : DeviceEntryFaceA override fun onPrimaryBouncerUserInput() {} override fun onAccessibilityAction() {} override fun onWalletLaunched() = Unit override fun onDeviceUnfolded() {} } packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.systemui.deviceentry.shared.model.ErrorFaceAuthenticationStat import com.android.systemui.deviceentry.shared.model.FaceAuthenticationStatus import com.android.systemui.keyguard.data.repository.BiometricSettingsRepository import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.DevicePosture import com.android.systemui.keyguard.shared.model.TransitionState import com.android.systemui.log.FaceAuthenticationLogger import com.android.systemui.power.domain.interactor.PowerInteractor Loading Loading @@ -244,6 +245,12 @@ constructor( } } override fun onDeviceUnfolded() { if (facePropertyRepository.supportedPostures.contains(DevicePosture.OPENED)) { runFaceAuth(FaceAuthUiEvent.FACE_AUTH_UPDATED_POSTURE_CHANGED, true) } } override fun registerListener(listener: FaceAuthenticationListener) { listeners.add(listener) } Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −5 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_OPENED; import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_UNKNOWN; import android.annotation.AnyThread; import android.annotation.MainThread; Loading Loading @@ -1868,7 +1867,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @Override public void onPostureChanged(@DevicePostureInt int posture) { if (posture == DEVICE_POSTURE_OPENED) { mLogger.d("Posture changed to open - attempting to request active unlock"); mLogger.d("Posture changed to open - attempting to request active" + " unlock and run face auth"); getFaceAuthInteractor().onDeviceUnfolded(); requestActiveUnlockFromWakeReason(PowerManager.WAKE_REASON_UNFOLD_DEVICE, false); } Loading Loading @@ -2434,9 +2435,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab updateFingerprintListeningState(BIOMETRIC_ACTION_START); } }); if (mConfigFaceAuthSupportedPosture != DEVICE_POSTURE_UNKNOWN) { mDevicePostureController.addCallback(mPostureCallback); } updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE); mTaskStackChangeListeners.registerTaskStackListener(mTaskStackListener); Loading
packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FacePropertyRepository.kt +12 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.shared.model.DevicePosture import com.android.systemui.res.R import java.util.concurrent.Executor import javax.inject.Inject Loading Loading @@ -68,6 +69,8 @@ interface FacePropertyRepository { /** The info of current available camera. */ val cameraInfo: StateFlow<CameraInfo?> val supportedPostures: List<DevicePosture> } /** Describes a biometric sensor */ Loading Loading @@ -188,6 +191,15 @@ constructor( initialValue = if (cameraInfoList.isNotEmpty()) cameraInfoList[0] else null ) private val supportedPosture = applicationContext.resources.getInteger(R.integer.config_face_auth_supported_posture) override val supportedPostures: List<DevicePosture> = if (supportedPosture == 0) { DevicePosture.entries } else { listOf(DevicePosture.toPosture(supportedPosture)) } private val defaultSensorLocation: StateFlow<Point?> = cameraInfo .map { it?.cameraLocation } Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ interface DeviceEntryFaceAuthInteractor { fun onPrimaryBouncerUserInput() fun onAccessibilityAction() fun onWalletLaunched() fun onDeviceUnfolded() /** Whether face auth is considered class 3 */ fun isFaceAuthStrong(): Boolean Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt +1 −0 Original line number Diff line number Diff line Loading @@ -66,4 +66,5 @@ class NoopDeviceEntryFaceAuthInteractor @Inject constructor() : DeviceEntryFaceA override fun onPrimaryBouncerUserInput() {} override fun onAccessibilityAction() {} override fun onWalletLaunched() = Unit override fun onDeviceUnfolded() {} }
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.systemui.deviceentry.shared.model.ErrorFaceAuthenticationStat import com.android.systemui.deviceentry.shared.model.FaceAuthenticationStatus import com.android.systemui.keyguard.data.repository.BiometricSettingsRepository import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.DevicePosture import com.android.systemui.keyguard.shared.model.TransitionState import com.android.systemui.log.FaceAuthenticationLogger import com.android.systemui.power.domain.interactor.PowerInteractor Loading Loading @@ -244,6 +245,12 @@ constructor( } } override fun onDeviceUnfolded() { if (facePropertyRepository.supportedPostures.contains(DevicePosture.OPENED)) { runFaceAuth(FaceAuthUiEvent.FACE_AUTH_UPDATED_POSTURE_CHANGED, true) } } override fun registerListener(listener: FaceAuthenticationListener) { listeners.add(listener) } Loading