Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java→packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -25,15 +25,14 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import android.graphics.Point; import android.os.PowerManager; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper.RunWithLooper; import android.view.View; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.keyguard.KeyguardUpdateMonitor; Loading Loading @@ -68,7 +67,7 @@ import java.util.Collections; import java.util.HashSet; @SmallTest @RunWith(AndroidTestingRunner.class) @RunWith(AndroidJUnit4.class) @RunWithLooper(setAsMainLooper = true) public class DozeServiceHostTest extends SysuiTestCase { Loading Loading @@ -181,6 +180,7 @@ public class DozeServiceHostTest extends SysuiTestCase { DozeLog.PULSE_REASON_DOCKING, DozeLog.REASON_SENSOR_WAKE_UP_PRESENCE, DozeLog.REASON_SENSOR_QUICK_PICKUP, DozeLog.PULSE_REASON_FINGERPRINT_ACTIVATED, DozeLog.REASON_SENSOR_TAP)); HashSet<Integer> reasonsThatDontPulse = new HashSet<>( Arrays.asList(DozeLog.REASON_SENSOR_PICKUP, Loading Loading @@ -232,7 +232,7 @@ public class DozeServiceHostTest extends SysuiTestCase { public void onSlpiTap_doesnt_pass_negative_values() { mDozeServiceHost.onSlpiTap(-1, 200); mDozeServiceHost.onSlpiTap(100, -2); verifyZeroInteractions(mDozeInteractor); verify(mDozeInteractor, never()).setLastTapToWakePosition(any()); } @Test public void dozeTimeTickSentToDozeInteractor() { Loading packages/SystemUI/res/values/config.xml +7 −1 Original line number Diff line number Diff line Loading @@ -962,11 +962,17 @@ <!-- Whether to show bottom sheets edge to edge --> <bool name="config_edgeToEdgeBottomSheetDialog">true</bool> <!-- Time in milliseconds the user has to touch the side FPS sensor to successfully authenticate when the screen is turned off with AOD not enabled. TODO(b/302332976) Get this value from the HAL if they can provide an API for it. --> <integer name="config_restToUnlockDurationScreenOff">500</integer> <!-- Time in milliseconds the user has to touch the side FPS sensor to successfully authenticate TODO(b/302332976) Get this value from the HAL if they can provide an API for it. --> <integer name="config_restToUnlockDuration">300</integer> <integer name="config_restToUnlockDurationDefault">300</integer> <!-- Width in pixels of the Side FPS sensor. Loading packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsSensorInteractor.kt +18 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import com.android.systemui.biometrics.shared.model.DisplayRotation import com.android.systemui.biometrics.shared.model.FingerprintSensorType import com.android.systemui.biometrics.shared.model.isDefaultOrientation import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.log.SideFpsLogger import com.android.systemui.res.R import java.util.Optional Loading @@ -47,6 +49,7 @@ constructor( windowManager: WindowManager, displayStateInteractor: DisplayStateInteractor, fingerprintInteractiveToAuthProvider: Optional<FingerprintInteractiveToAuthProvider>, keyguardTransitionInteractor: KeyguardTransitionInteractor, private val logger: SideFpsLogger, ) { Loading @@ -62,8 +65,21 @@ constructor( val isAvailable: Flow<Boolean> = fingerprintPropertyRepository.sensorType.map { it == FingerprintSensorType.POWER_BUTTON } val authenticationDuration: Long = context.resources?.getInteger(R.integer.config_restToUnlockDuration)?.toLong() ?: 0L val authenticationDuration: Flow<Long> = keyguardTransitionInteractor .isFinishedInStateWhere { it == KeyguardState.OFF || it == KeyguardState.DOZING } .map { if (it) context.resources ?.getInteger(R.integer.config_restToUnlockDurationScreenOff) ?.toLong() else context.resources ?.getInteger(R.integer.config_restToUnlockDurationDefault) ?.toLong() } .map { it ?: 0L } .onEach { logger.authDurationChanged(it) } val isProlongedTouchRequiredForAuthentication: Flow<Boolean> = if (fingerprintInteractiveToAuthProvider.isEmpty) { Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFingerprintAuthInteractor.kt +8 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.deviceentry.domain.interactor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.data.repository.DeviceEntryFingerprintAuthRepository import com.android.systemui.keyguard.shared.model.FailFingerprintAuthenticationStatus import com.android.systemui.keyguard.shared.model.FingerprintAuthenticationStatus import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filterIsInstance Loading @@ -31,4 +32,11 @@ constructor( ) { val fingerprintFailure: Flow<FailFingerprintAuthenticationStatus> = repository.authenticationStatus.filterIsInstance<FailFingerprintAuthenticationStatus>() /** Whether fingerprint authentication is currently running or not */ val isRunning: Flow<Boolean> = repository.isRunning /** Provide the current status of fingerprint authentication. */ val authenticationStatus: Flow<FingerprintAuthenticationStatus> = repository.authenticationStatus } packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +5 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,11 @@ public interface DozeHost { * Called when the dozing state may have been updated. */ default void onDozingChanged(boolean isDozing) {} /** * Called when fingerprint acquisition has started and screen state might need updating. */ default void onSideFingerprintAcquisitionStarted() {} } interface PulseCallback { Loading Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java→packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -25,15 +25,14 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import android.graphics.Point; import android.os.PowerManager; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper.RunWithLooper; import android.view.View; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.keyguard.KeyguardUpdateMonitor; Loading Loading @@ -68,7 +67,7 @@ import java.util.Collections; import java.util.HashSet; @SmallTest @RunWith(AndroidTestingRunner.class) @RunWith(AndroidJUnit4.class) @RunWithLooper(setAsMainLooper = true) public class DozeServiceHostTest extends SysuiTestCase { Loading Loading @@ -181,6 +180,7 @@ public class DozeServiceHostTest extends SysuiTestCase { DozeLog.PULSE_REASON_DOCKING, DozeLog.REASON_SENSOR_WAKE_UP_PRESENCE, DozeLog.REASON_SENSOR_QUICK_PICKUP, DozeLog.PULSE_REASON_FINGERPRINT_ACTIVATED, DozeLog.REASON_SENSOR_TAP)); HashSet<Integer> reasonsThatDontPulse = new HashSet<>( Arrays.asList(DozeLog.REASON_SENSOR_PICKUP, Loading Loading @@ -232,7 +232,7 @@ public class DozeServiceHostTest extends SysuiTestCase { public void onSlpiTap_doesnt_pass_negative_values() { mDozeServiceHost.onSlpiTap(-1, 200); mDozeServiceHost.onSlpiTap(100, -2); verifyZeroInteractions(mDozeInteractor); verify(mDozeInteractor, never()).setLastTapToWakePosition(any()); } @Test public void dozeTimeTickSentToDozeInteractor() { Loading
packages/SystemUI/res/values/config.xml +7 −1 Original line number Diff line number Diff line Loading @@ -962,11 +962,17 @@ <!-- Whether to show bottom sheets edge to edge --> <bool name="config_edgeToEdgeBottomSheetDialog">true</bool> <!-- Time in milliseconds the user has to touch the side FPS sensor to successfully authenticate when the screen is turned off with AOD not enabled. TODO(b/302332976) Get this value from the HAL if they can provide an API for it. --> <integer name="config_restToUnlockDurationScreenOff">500</integer> <!-- Time in milliseconds the user has to touch the side FPS sensor to successfully authenticate TODO(b/302332976) Get this value from the HAL if they can provide an API for it. --> <integer name="config_restToUnlockDuration">300</integer> <integer name="config_restToUnlockDurationDefault">300</integer> <!-- Width in pixels of the Side FPS sensor. Loading
packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsSensorInteractor.kt +18 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import com.android.systemui.biometrics.shared.model.DisplayRotation import com.android.systemui.biometrics.shared.model.FingerprintSensorType import com.android.systemui.biometrics.shared.model.isDefaultOrientation import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.log.SideFpsLogger import com.android.systemui.res.R import java.util.Optional Loading @@ -47,6 +49,7 @@ constructor( windowManager: WindowManager, displayStateInteractor: DisplayStateInteractor, fingerprintInteractiveToAuthProvider: Optional<FingerprintInteractiveToAuthProvider>, keyguardTransitionInteractor: KeyguardTransitionInteractor, private val logger: SideFpsLogger, ) { Loading @@ -62,8 +65,21 @@ constructor( val isAvailable: Flow<Boolean> = fingerprintPropertyRepository.sensorType.map { it == FingerprintSensorType.POWER_BUTTON } val authenticationDuration: Long = context.resources?.getInteger(R.integer.config_restToUnlockDuration)?.toLong() ?: 0L val authenticationDuration: Flow<Long> = keyguardTransitionInteractor .isFinishedInStateWhere { it == KeyguardState.OFF || it == KeyguardState.DOZING } .map { if (it) context.resources ?.getInteger(R.integer.config_restToUnlockDurationScreenOff) ?.toLong() else context.resources ?.getInteger(R.integer.config_restToUnlockDurationDefault) ?.toLong() } .map { it ?: 0L } .onEach { logger.authDurationChanged(it) } val isProlongedTouchRequiredForAuthentication: Flow<Boolean> = if (fingerprintInteractiveToAuthProvider.isEmpty) { Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFingerprintAuthInteractor.kt +8 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.deviceentry.domain.interactor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.data.repository.DeviceEntryFingerprintAuthRepository import com.android.systemui.keyguard.shared.model.FailFingerprintAuthenticationStatus import com.android.systemui.keyguard.shared.model.FingerprintAuthenticationStatus import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filterIsInstance Loading @@ -31,4 +32,11 @@ constructor( ) { val fingerprintFailure: Flow<FailFingerprintAuthenticationStatus> = repository.authenticationStatus.filterIsInstance<FailFingerprintAuthenticationStatus>() /** Whether fingerprint authentication is currently running or not */ val isRunning: Flow<Boolean> = repository.isRunning /** Provide the current status of fingerprint authentication. */ val authenticationStatus: Flow<FingerprintAuthenticationStatus> = repository.authenticationStatus }
packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +5 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,11 @@ public interface DozeHost { * Called when the dozing state may have been updated. */ default void onDozingChanged(boolean isDozing) {} /** * Called when fingerprint acquisition has started and screen state might need updating. */ default void onSideFingerprintAcquisitionStarted() {} } interface PulseCallback { Loading