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

Commit cbb5b499 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove accessbility title for biometric prompt" into main

parents 0ddc1025 a4398955
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -531,20 +531,23 @@ open class AuthContainerViewTest : SysuiTestCase() {

    @Test
    fun testLayoutParams_hasSecureWindowFlag() {
        val layoutParams = AuthContainerView.getLayoutParams(windowToken, "")
        val layoutParams =
            AuthContainerView.getLayoutParams(windowToken, "", false /* isCredentialView */)
        assertThat((layoutParams.flags and WindowManager.LayoutParams.FLAG_SECURE) != 0).isTrue()
    }

    @Test
    fun testLayoutParams_hasShowWhenLockedFlag() {
        val layoutParams = AuthContainerView.getLayoutParams(windowToken, "")
        val layoutParams =
            AuthContainerView.getLayoutParams(windowToken, "", false /* isCredentialView */)
        assertThat((layoutParams.flags and WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED) != 0)
            .isTrue()
    }

    @Test
    fun testLayoutParams_hasDimbehindWindowFlag() {
        val layoutParams = AuthContainerView.getLayoutParams(windowToken, "")
        val layoutParams =
            AuthContainerView.getLayoutParams(windowToken, "", false /* isCredentialView */)
        val lpFlags = layoutParams.flags
        val lpDimAmount = layoutParams.dimAmount

@@ -554,7 +557,8 @@ open class AuthContainerViewTest : SysuiTestCase() {

    @Test
    fun testLayoutParams_excludesImeInsets() {
        val layoutParams = AuthContainerView.getLayoutParams(windowToken, "")
        val layoutParams =
            AuthContainerView.getLayoutParams(windowToken, "", false /* isCredentialView */)
        assertThat((layoutParams.fitInsetsTypes and WindowInsets.Type.ime()) == 0).isTrue()
    }

@@ -706,7 +710,8 @@ open class AuthContainerViewTest : SysuiTestCase() {

    @Test
    fun testLayoutParams_hasCutoutModeAlwaysFlag() {
        val layoutParams = AuthContainerView.getLayoutParams(windowToken, "")
        val layoutParams =
            AuthContainerView.getLayoutParams(windowToken, "", false /* isCredentialView */)
        val lpFlags = layoutParams.flags

        assertThat(
@@ -717,7 +722,8 @@ open class AuthContainerViewTest : SysuiTestCase() {

    @Test
    fun testLayoutParams_excludesSystemBarInsets() {
        val layoutParams = AuthContainerView.getLayoutParams(windowToken, "")
        val layoutParams =
            AuthContainerView.getLayoutParams(windowToken, "", false /* isCredentialView */)
        assertThat((layoutParams.fitInsetsTypes and WindowInsets.Type.systemBars()) == 0).isTrue()
    }
}
+5 −3
Original line number Diff line number Diff line
@@ -539,7 +539,8 @@ public class AuthContainerView extends LinearLayout
    }

    public void show(WindowManager wm) {
        wm.addView(this, getLayoutParams(mWindowToken, mConfig.mPromptInfo.getTitle()));
        wm.addView(this, getLayoutParams(mWindowToken, mConfig.mPromptInfo.getTitle(),
                mPromptViewModel.getPromptKind().getValue().isCredential()));
    }

    private void forceExecuteAnimatedIn() {
@@ -738,7 +739,8 @@ public class AuthContainerView extends LinearLayout
    }

    @VisibleForTesting
    static WindowManager.LayoutParams getLayoutParams(IBinder windowToken, CharSequence title) {
    static WindowManager.LayoutParams getLayoutParams(IBinder windowToken, CharSequence title,
            boolean isCredentialView) {
        final int windowFlags = WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
                | WindowManager.LayoutParams.FLAG_SECURE
                | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
@@ -754,7 +756,7 @@ public class AuthContainerView extends LinearLayout
                & ~WindowInsets.Type.systemBars());
        lp.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
        lp.setTitle("BiometricPrompt");
        lp.accessibilityTitle = title;
        lp.accessibilityTitle = isCredentialView ? " " : title;
        lp.dimAmount = BACKGROUND_DIM_AMOUNT;
        lp.token = windowToken;
        return lp;