Fixed a bug where not enough notifications were shown on lockscreen
Change-Id: Ia1a869d12e01d0787f873399bf68b48215a65e0c
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index a781585..55b9d83 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1292,9 +1292,9 @@
}
/**
- * Called when the panel was layouted expanded for the first time after being collapsed.
+ * Called when the size of the notification panel changes
*/
- public void onPanelExpandedAndLayouted() {
+ public void onPanelHeightChanged() {
if (mState == StatusBarState.KEYGUARD) {
// Since the number of notifications is determined based on the height of the view, we
// need to update them.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 21d803d..5e54ba7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -82,6 +82,7 @@
private boolean mMotionAborted;
private boolean mUpwardsWhenTresholdReached;
private boolean mAnimatingOnDown;
+ private int mLayoutHeight = 0;
private ValueAnimator mHeightAnimator;
private ObjectAnimator mPeekAnimator;
@@ -716,6 +717,10 @@
@Override
protected void onLayout (boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
+ if (mLayoutHeight != getHeight()) {
+ mLayoutHeight = getHeight();
+ mStatusBar.onPanelHeightChanged();
+ }
requestPanelHeightUpdate();
mHasLayoutedSinceDown = true;
if (mUpdateFlingOnLayout) {
@@ -889,7 +894,6 @@
if (mStatusBar.getStatusBarWindow().getHeight()
!= mStatusBar.getStatusBarHeight()) {
getViewTreeObserver().removeOnGlobalLayoutListener(this);
- mStatusBar.onPanelExpandedAndLayouted();
if (animate) {
mBar.startOpeningPanel(PanelView.this);
notifyExpandingStarted();