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

Commit 05e89cfe authored by Joe Bolinger's avatar Joe Bolinger Committed by Android (Google) Code Review
Browse files

Merge "Prevent talkback from annoucing the "System UI" container when...

Merge "Prevent talkback from annoucing the "System UI" container when BiometricPrompt is activated." into sc-dev
parents da142e9a eca419fe
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -596,10 +596,6 @@ public abstract class AuthBiometricView extends LinearLayout {
        Utils.notifyAccessibilityContentChanged(mAccessibilityManager, this);
    }

    private void setText(TextView view, CharSequence charSequence) {
        view.setText(charSequence);
    }

    // Remove all pending icon and text animations
    private void removePendingAnimations() {
        mHandler.removeCallbacks(mResetHelpRunnable);
@@ -688,7 +684,7 @@ public abstract class AuthBiometricView extends LinearLayout {
     */
    @VisibleForTesting
    void onAttachedToWindowInternal() {
        setText(mTitleView, mPromptInfo.getTitle());
        mTitleView.setText(mPromptInfo.getTitle());

        if (isDeviceCredentialAllowed()) {
            final CharSequence credentialButtonText;
@@ -718,7 +714,7 @@ public abstract class AuthBiometricView extends LinearLayout {
            mUseCredentialButton.setText(credentialButtonText);
            mUseCredentialButton.setVisibility(View.VISIBLE);
        } else {
            setText(mNegativeButton, mPromptInfo.getNegativeButtonText());
            mNegativeButton.setText(mPromptInfo.getNegativeButtonText());
        }

        setTextOrHide(mSubtitleView, mPromptInfo.getSubtitle());
+5 −6
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ public class AuthContainerView extends LinearLayout
        if (mBiometricView != null) {
            mBiometricView.restoreState(savedState);
        }
        wm.addView(this, getLayoutParams(mWindowToken));
        wm.addView(this, getLayoutParams(mWindowToken, mConfig.mPromptInfo.getTitle()));
    }

    @Override
@@ -728,11 +728,9 @@ public class AuthContainerView extends LinearLayout
        }
    }

    /**
     * @param windowToken token for the window
     * @return
     */
    public static WindowManager.LayoutParams getLayoutParams(IBinder windowToken) {
    @VisibleForTesting
    static WindowManager.LayoutParams getLayoutParams(IBinder windowToken,
            CharSequence title) {
        final int windowFlags = WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
                | WindowManager.LayoutParams.FLAG_SECURE;
        final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
@@ -744,6 +742,7 @@ public class AuthContainerView extends LinearLayout
        lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
        lp.setFitInsetsTypes(lp.getFitInsetsTypes() & ~WindowInsets.Type.ime());
        lp.setTitle("BiometricPrompt");
        lp.accessibilityTitle = title;
        lp.token = windowToken;
        return lp;
    }
+2 −2
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ public class AuthContainerViewTest extends SysuiTestCase {
    public void testLayoutParams_hasSecureWindowFlag() {
        final IBinder windowToken = mock(IBinder.class);
        final WindowManager.LayoutParams layoutParams =
                AuthContainerView.getLayoutParams(windowToken);
                AuthContainerView.getLayoutParams(windowToken, "");
        assertTrue((layoutParams.flags & WindowManager.LayoutParams.FLAG_SECURE) != 0);
    }

@@ -232,7 +232,7 @@ public class AuthContainerViewTest extends SysuiTestCase {
    public void testLayoutParams_excludesImeInsets() {
        final IBinder windowToken = mock(IBinder.class);
        final WindowManager.LayoutParams layoutParams =
                AuthContainerView.getLayoutParams(windowToken);
                AuthContainerView.getLayoutParams(windowToken, "");
        assertTrue((layoutParams.getFitInsetsTypes() & WindowInsets.Type.ime()) == 0);
    }