Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01431320 authored by Beverly's avatar Beverly
Browse files

Add the alternate bouncer as its own window

It needs to show above SysUI dialogs, so it can't
live in NotificationShadeWindowView (super_notification_shade.xml).

Since the alternate bouncer no longer lives in the
notification shade, touches to the alt bouncer are not considered
in the falsing algo, nor do touches keep the screen awake.
Therefore, we manually inform the powerManager of user gestures
like tap and swipe up on the alternate bouncer. However, we don't
count other swipes on the altBouncer (essentially "falsing") and
allow the device to sleep with its 10s keyguard timeout if no
valid touches on the altBouncer or fingerprint sensor occur.

Test: atest AlternateBouncerWindowViewModelTest
Bug: 327257758
Flag: ACONFIG com.android.systemui.device_entry_udfps_refactor TEAMFOOD
Change-Id: If7f2ec09fe53dd3dfe1b09847d92b1fdc2c6e81b
parent 7e37a4b0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -22,8 +22,7 @@
    android:focusable="true"
    android:clickable="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="invisible">
    android:layout_height="match_parent">

    <com.android.systemui.scrim.ScrimView
        android:id="@+id/alternate_bouncer_scrim"
+0 −4
Original line number Diff line number Diff line
@@ -117,10 +117,6 @@
        android:inflatedId="@+id/multi_shade"
        android:layout="@layout/multi_shade" />

    <include layout="@layout/alternate_bouncer"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <com.android.systemui.biometrics.AuthRippleView
        android:id="@+id/auth_ripple"
        android:layout_width="match_parent"
+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.android.systemui.biometrics.udfps.EllipseOverlapDetector
import com.android.systemui.biometrics.udfps.OverlapDetector
import com.android.systemui.biometrics.ui.binder.SideFpsOverlayViewBinder
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.ui.binder.AlternateBouncerViewBinder
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener
import com.android.systemui.util.concurrency.ThreadFactory
import dagger.Binds
@@ -69,6 +70,11 @@ interface BiometricsModule {
    @ClassKey(SideFpsOverlayViewBinder::class)
    fun bindsSideFpsOverlayViewBinder(viewBinder: SideFpsOverlayViewBinder): CoreStartable

    @Binds
    @IntoMap
    @ClassKey(AlternateBouncerViewBinder::class)
    fun bindAlternateBouncerViewBinder(viewBinder: AlternateBouncerViewBinder): CoreStartable

    @Binds
    @SysUISingleton
    fun faceSettings(impl: FaceSettingsRepositoryImpl): FaceSettingsRepository
+5 −10
Original line number Diff line number Diff line
@@ -38,19 +38,14 @@ constructor(
    alternateBouncerInteractor: AlternateBouncerInteractor,
    systemUIDialogManager: SystemUIDialogManager,
) : UdfpsTouchOverlayViewModel {
    private val showingUdfpsAffordance: Flow<Boolean> =
    override val shouldHandleTouches: Flow<Boolean> =
        combine(
            deviceEntryIconViewModel.deviceEntryViewAlpha,
            alternateBouncerInteractor.isVisible,
        ) { deviceEntryViewAlpha, alternateBouncerVisible ->
            deviceEntryViewAlpha > ALLOW_TOUCH_ALPHA_THRESHOLD || alternateBouncerVisible
        }
    override val shouldHandleTouches: Flow<Boolean> =
        combine(
            showingUdfpsAffordance,
            systemUIDialogManager.hideAffordancesRequest,
        ) { showingUdfpsAffordance, dialogRequestingHideAffordances ->
            showingUdfpsAffordance && !dialogRequestingHideAffordances
            systemUIDialogManager.hideAffordancesRequest
        ) { deviceEntryViewAlpha, alternateBouncerVisible, hideAffordancesRequest ->
            (deviceEntryViewAlpha > ALLOW_TOUCH_ALPHA_THRESHOLD && !hideAffordancesRequest) ||
                alternateBouncerVisible
        }

    companion object {
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ constructor(
    var receivedDownTouch = false
    val isVisible: Flow<Boolean> = bouncerRepository.alternateBouncerVisible
    private val alternateBouncerUiAvailableFromSource: HashSet<String> = HashSet()
    private val alternateBouncerSupported: StateFlow<Boolean> =
    val alternateBouncerSupported: StateFlow<Boolean> =
        if (DeviceEntryUdfpsRefactor.isEnabled) {
            fingerprintPropertyRepository.sensorType
                .map { sensorType -> sensorType.isUdfps() || sensorType.isPowerButton() }
Loading