summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2021-06-09 02:43:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-06-09 02:43:26 +0000
commit6c9c6cb626f16c491131e73fd6957d261edf2533 (patch)
tree2c6d94cc05860bdaca042bd2aac27c6327695185
parent08a0b629cbd2969e1297a055a6cf34762174c2dc (diff)
parent042fb825609027aaccf135e0353befacba18887c (diff)
Merge "Fix lockscreen notification + media counting." into sc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java37
2 files changed, 26 insertions, 17 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 9390c81a847b..2c2a17001326 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -2097,11 +2097,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
if (height != 0) {
height += mPaddingBetweenElements;
}
- height += calculateGapHeight(previousView, expandableView, numShownItems);
+ float gapHeight = calculateGapHeight(previousView, expandableView, numShownNotifs);
+ height += gapHeight;
height += viewHeight;
numShownItems++;
- if (!(expandableView instanceof MediaHeaderView)) {
+ if (viewHeight > 0 || !(expandableView instanceof MediaHeaderView)) {
+ // Only count the media as a notification if it has a positive height.
numShownNotifs++;
}
previousView = expandableView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index fda24c17990b..e2d64b09aee9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -139,6 +139,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView;
import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
+import com.android.systemui.statusbar.notification.stack.MediaHeaderView;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
@@ -1325,21 +1326,27 @@ public class NotificationPanelViewController extends PanelViewController {
ExpandableView previousView = null;
for (int i = 0; i < mNotificationStackScrollLayoutController.getChildCount(); i++) {
ExpandableView child = mNotificationStackScrollLayoutController.getChildAt(i);
- if (!(child instanceof ExpandableNotificationRow)) {
- continue;
- }
- ExpandableNotificationRow row = (ExpandableNotificationRow) child;
- boolean
- suppressedSummary =
- mGroupManager != null && mGroupManager.isSummaryOfSuppressedGroup(
- row.getEntry().getSbn());
- if (suppressedSummary) {
- continue;
- }
- if (!canShowViewOnLockscreen(child)) {
- continue;
- }
- if (row.isRemoved()) {
+ if (child instanceof ExpandableNotificationRow) {
+ ExpandableNotificationRow row = (ExpandableNotificationRow) child;
+ boolean suppressedSummary = mGroupManager != null
+ && mGroupManager.isSummaryOfSuppressedGroup(row.getEntry().getSbn());
+ if (suppressedSummary) {
+ continue;
+ }
+ if (!canShowViewOnLockscreen(child)) {
+ continue;
+ }
+ if (row.isRemoved()) {
+ continue;
+ }
+ } else if (child instanceof MediaHeaderView) {
+ if (child.getVisibility() == GONE) {
+ continue;
+ }
+ if (child.getIntrinsicHeight() == 0) {
+ continue;
+ }
+ } else {
continue;
}
availableSpace -= child.getMinHeight(true /* ignoreTemporaryStates */);