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

Commit fb057310 authored by Joe Bolinger's avatar Joe Bolinger Committed by Automerger Merge Worker
Browse files

Merge "Update new BiometricPromptLayout to include cutout region." into...

Merge "Update new BiometricPromptLayout to include cutout region." into udc-dev am: 1b99cfcf am: 2ade4f03 am: 35f63656

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23353838



Change-Id: Ia527f7139f8ebde54199799712fcb09777063556
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 42ba7b35 35f63656
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -19,9 +19,12 @@ package com.android.systemui.biometrics.ui;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Insets;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -44,6 +47,8 @@ public class BiometricPromptLayout extends LinearLayout {

    private static final String TAG = "BiometricPromptLayout";

    @NonNull
    private final WindowManager mWindowManager;
    @Nullable
    private AuthController.ScaleFactorProvider mScaleFactorProvider;
    @Nullable
@@ -60,6 +65,8 @@ public class BiometricPromptLayout extends LinearLayout {
    public BiometricPromptLayout(Context context, AttributeSet attrs) {
        super(context, attrs);

        mWindowManager = context.getSystemService(WindowManager.class);

        mUseCustomBpSize = getResources().getBoolean(R.bool.use_custom_bp_size);
        mCustomBpWidth = getResources().getDimensionPixelSize(R.dimen.biometric_dialog_width);
        mCustomBpHeight = getResources().getDimensionPixelSize(R.dimen.biometric_dialog_height);
@@ -144,8 +151,13 @@ public class BiometricPromptLayout extends LinearLayout {
            width = Math.min(width, height);
        }

        // add nav bar insets since the parent AuthContainerView
        // uses LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
        final Insets insets = mWindowManager.getMaximumWindowMetrics().getWindowInsets()
                .getInsets(WindowInsets.Type.navigationBars());
        final AuthDialog.LayoutParams params = onMeasureInternal(width, height);
        setMeasuredDimension(params.mMediumWidth, params.mMediumHeight);
        setMeasuredDimension(params.mMediumWidth + insets.left + insets.right,
                params.mMediumHeight + insets.bottom);
    }

    @Override