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

Commit 238e14a0 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Announce SideFPS indicator when it's shown" into main

parents adefe413 17d969dd
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -19,8 +19,6 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sysui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/alternate_bouncer"
    android:focusable="true"
    android:clickable="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

+1 −2
Original line number Diff line number Diff line
@@ -22,5 +22,4 @@
    android:layout_height="wrap_content"
    app:lottie_autoPlay="true"
    app:lottie_loop="true"
    app:lottie_rawRes="@raw/sfps_pulse"
    android:importantForAccessibility="no"/>
 No newline at end of file
    app:lottie_rawRes="@raw/sfps_pulse"/>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -139,6 +139,11 @@ constructor(
        overlayView!!.visibility = View.INVISIBLE
        Log.d(TAG, "show(): adding overlayView $overlayView")
        windowManager.get().addView(overlayView, overlayViewModel.defaultOverlayViewParams)
        overlayView!!.announceForAccessibility(
            applicationContext.resources.getString(
                R.string.accessibility_side_fingerprint_indicator_label
            )
        )
    }

    /** Hide the side fingerprint sensor indicator */
+4 −0
Original line number Diff line number Diff line
@@ -86,7 +86,10 @@ constructor(
                    privateFlags =
                        WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY or
                            WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION
                    // Avoid announcing window title.
                    accessibilityTitle = " "
                }

    private var alternateBouncerView: ConstraintLayout? = null

    override fun start() {
@@ -304,6 +307,7 @@ constructor(
            }
        }
    }

    companion object {
        private const val TAG = "AlternateBouncerViewBinder"
        private const val swipeTag = "AlternateBouncer-SWIPE"
+8 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
import org.mockito.kotlin.argumentCaptor

@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@@ -218,6 +219,13 @@ class SideFpsOverlayViewBinderTest : SysuiTestCase() {

            verify(kosmos.windowManager).addView(any(), any())

            var viewCaptor = argumentCaptor<View>()
            verify(kosmos.windowManager).addView(viewCaptor.capture(), any())
            verify(viewCaptor.firstValue)
                .announceForAccessibility(
                    mContext.getText(R.string.accessibility_side_fingerprint_indicator_label)
                )

            // Hide alternate bouncer
            kosmos.keyguardBouncerRepository.setAlternateVisible(false)
            runCurrent()