Merge "Fix lockscreen notification + media counting." into sc-dev am: 6c9c6cb626

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14907890

Change-Id: I70770d71053cb8474a13729fc669ffab871b4281
This commit is contained in:
Jeff DeCew
2021-06-09 03:03:52 +00:00
committed by Automerger Merge Worker
2 changed files with 26 additions and 17 deletions

View File

@@ -2097,11 +2097,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
if (height != 0) { if (height != 0) {
height += mPaddingBetweenElements; height += mPaddingBetweenElements;
} }
height += calculateGapHeight(previousView, expandableView, numShownItems); float gapHeight = calculateGapHeight(previousView, expandableView, numShownNotifs);
height += gapHeight;
height += viewHeight; height += viewHeight;
numShownItems++; 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++; numShownNotifs++;
} }
previousView = expandableView; previousView = expandableView;

View File

@@ -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.row.ExpandableView;
import com.android.systemui.statusbar.notification.stack.AmbientState; import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.notification.stack.AnimationProperties; 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.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
@@ -1332,14 +1333,10 @@ public class NotificationPanelViewController extends PanelViewController {
ExpandableView previousView = null; ExpandableView previousView = null;
for (int i = 0; i < mNotificationStackScrollLayoutController.getChildCount(); i++) { for (int i = 0; i < mNotificationStackScrollLayoutController.getChildCount(); i++) {
ExpandableView child = mNotificationStackScrollLayoutController.getChildAt(i); ExpandableView child = mNotificationStackScrollLayoutController.getChildAt(i);
if (!(child instanceof ExpandableNotificationRow)) { if (child instanceof ExpandableNotificationRow) {
continue;
}
ExpandableNotificationRow row = (ExpandableNotificationRow) child; ExpandableNotificationRow row = (ExpandableNotificationRow) child;
boolean boolean suppressedSummary = mGroupManager != null
suppressedSummary = && mGroupManager.isSummaryOfSuppressedGroup(row.getEntry().getSbn());
mGroupManager != null && mGroupManager.isSummaryOfSuppressedGroup(
row.getEntry().getSbn());
if (suppressedSummary) { if (suppressedSummary) {
continue; continue;
} }
@@ -1349,6 +1346,16 @@ public class NotificationPanelViewController extends PanelViewController {
if (row.isRemoved()) { if (row.isRemoved()) {
continue; continue;
} }
} else if (child instanceof MediaHeaderView) {
if (child.getVisibility() == GONE) {
continue;
}
if (child.getIntrinsicHeight() == 0) {
continue;
}
} else {
continue;
}
availableSpace -= child.getMinHeight(true /* ignoreTemporaryStates */); availableSpace -= child.getMinHeight(true /* ignoreTemporaryStates */);
availableSpace -= count == 0 ? 0 : notificationPadding; availableSpace -= count == 0 ? 0 : notificationPadding;
availableSpace -= mNotificationStackScrollLayoutController availableSpace -= mNotificationStackScrollLayoutController