Fix jank while unlocking and security is set
- Delay showing the bouncer and playing the entrance animation for a
couple of frames.
- Do not disable back button on the normal Keyguard. This makes the
entrance animation nicer and fixes some jank due to the need to
draw into both windows.
- Prevent setPadding(...) call when nothing changes. setPadding would
invalidate the padding for the whole view hierarchy, which results
in a slower measure() when setting the window to invisible.
Bug: 17419960
Change-Id: I4a239d4af40ad86875e4a0dd08473f19a5c9b961
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index 42cfd39..78554525 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -55,12 +55,24 @@
@Override
protected boolean fitSystemWindows(Rect insets) {
if (getFitsSystemWindows()) {
- setPadding(insets.left, insets.top, insets.right, 0);
+ boolean changed = insets.left != getPaddingLeft()
+ || insets.top != getPaddingTop()
+ || insets.right != getPaddingRight()
+ || insets.bottom != getPaddingBottom();
+ if (changed) {
+ setPadding(insets.left, insets.top, insets.right, 0);
+ }
insets.left = 0;
insets.top = 0;
insets.right = 0;
} else {
- setPadding(0, 0, 0, 0);
+ boolean changed = getPaddingLeft() != 0
+ || getPaddingRight() != 0
+ || getPaddingTop() != 0
+ || getPaddingBottom() != 0;
+ if (changed) {
+ setPadding(0, 0, 0, 0);
+ }
}
return false;
}