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

Commit 868f3d76 authored by Grace Cheng's avatar Grace Cheng
Browse files

Replace UDFPS lockscreen a11y announcements with live region

Sets UdfpsAccessibilityOverlay accessibilityLiveRegion to
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, updates contentDescription with
UDFPS guidance messages, and removes a11y announcements

Flag: NONE bug fix
Bug: 383230658
Test: (manual) verified Talkback reads expected messages
Change-Id: Ia6a619840d2ad97204b438323a5e47215680b5d2
parent b8fefc10
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -20,4 +20,8 @@ import android.content.Context
import android.view.View

/** Overlay to handle under-fingerprint sensor accessibility events. */
class UdfpsAccessibilityOverlay(context: Context?) : View(context)
class UdfpsAccessibilityOverlay(context: Context?) : View(context) {
    init {
        accessibilityLiveRegion = ACCESSIBILITY_LIVE_REGION_ASSERTIVE
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ abstract class UdfpsAccessibilityOverlayViewModel(
                event.getPointerId(0),
                event,
                overlayParams, /* rotateToPortrait */
                false
                false,
            )

        if (
@@ -64,7 +64,7 @@ abstract class UdfpsAccessibilityOverlayViewModel(
                event.getPointerId(0),
                event,
                overlayParams,
                /* rotateTouchToPortrait */ false
                /* rotateTouchToPortrait */ false,
            )
        ) {
            // view only receives motionEvents when [visible] which requires touchExplorationEnabled
@@ -75,10 +75,10 @@ abstract class UdfpsAccessibilityOverlayViewModel(
                    scaledTouch.x,
                    scaledTouch.y,
                    overlayParams,
                    /* touchRotatedToPortrait */ false
                    /* touchRotatedToPortrait */ false,
                )
            if (announceStr != null) {
                v.announceForAccessibility(announceStr)
                v.contentDescription = announceStr
            }
        }
        // always let the motion events go through to underlying views