diff options
author | Xiyuan Xia <xiyuan@google.com> | 2015-05-28 14:57:21 -0700 |
---|---|---|
committer | Xiyuan Xia <xiyuan@google.com> | 2015-05-28 14:57:21 -0700 |
commit | 79f38a2e32c38e3e7ef5be515afb7d3976bac22b (patch) | |
tree | 617c7a4b56e9df6a036936bba414cc1cdb1891d6 /packages | |
parent | cd8190f16b6691eaeefa932cb68b1dc6f2665a0b (diff) | |
download | frameworks_base-79f38a2e32c38e3e7ef5be515afb7d3976bac22b.zip frameworks_base-79f38a2e32c38e3e7ef5be515afb7d3976bac22b.tar.gz frameworks_base-79f38a2e32c38e3e7ef5be515afb7d3976bac22b.tar.bz2 |
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
Diffstat (limited to 'packages')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java index 1c4b963..54467f3 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityViewFlipper.java @@ -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; |