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

Commit 79f38a2e authored by Xiyuan Xia's avatar Xiyuan Xia
Browse files

Avoid keyguard UI layout dimensions underflow

KeyguardBouncer could have 0 as its content area size. Two transient
cases found: on device boot with a 0 sized StatusBarWindowView and
first time showing after user switching. Be defensive and protect
against the case.

Bug:21333202
Change-Id: I73eabf64c597ea3ae96ccfba1aecf702da8dfb23
parent cd8190f1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -203,8 +203,8 @@ public class KeyguardSecurityViewFlipper extends ViewFlipper implements Keyguard

        final int wPadding = getPaddingLeft() + getPaddingRight();
        final int hPadding = getPaddingTop() + getPaddingBottom();
        maxWidth -= wPadding;
        maxHeight -= hPadding;
        maxWidth = Math.max(0, maxWidth - wPadding);
        maxHeight = Math.max(0, maxHeight - hPadding);

        int width = widthMode == MeasureSpec.EXACTLY ? widthSize : 0;
        int height = heightMode == MeasureSpec.EXACTLY ? heightSize : 0;