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

Commit f7c5973e authored by Kevin Chyn's avatar Kevin Chyn Committed by Automerger Merge Worker
Browse files

Merge changes I59089884,I0ec61e11 into sc-v2-dev am: 7a8f7189 am: 97613d7c

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

Change-Id: I0d96e1fbe36e0ab5f62a5e67246109bd1741d1e7
parents 84a40f91 97613d7c
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -824,12 +824,8 @@ public abstract class AuthBiometricView extends LinearLayout {
        return new AuthDialog.LayoutParams(width, totalHeight);
    }

    /**
     * Simple heuristic which should return true displays that are larger than a normal phone.
     * For example, tablet displays, or the unfolded display for foldables.
     */
    private boolean isLargeDisplay(int width, int height) {
        return width > 1200 && height > 1200;
    private boolean isLargeDisplay() {
        return com.android.systemui.util.Utils.shouldUseSplitNotificationShade(getResources());
    }

    @Override
@@ -837,12 +833,12 @@ public abstract class AuthBiometricView extends LinearLayout {
        final int width = MeasureSpec.getSize(widthMeasureSpec);
        final int height = MeasureSpec.getSize(heightMeasureSpec);

        Log.d(TAG, "Width: " + width + ", height: " + height);
        final boolean isLargeDisplay = isLargeDisplay();

        final int newWidth;
        if (isLargeDisplay(width, height)) {
            // TODO: Unless we can come up with a one-size-fits-all equation, we may want to
            //  consider moving this to an overlay.
        if (isLargeDisplay) {
            // TODO(b/201811580): Unless we can come up with a one-size-fits-all equation, we may
            //  want to consider moving this to an overlay.
            newWidth = 2 * Math.min(width, height) / 3;
        } else {
            newWidth = Math.min(width, height);