summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2024-02-22 21:20:49 +0000
committer Jeff DeCew <jeffdq@google.com> 2024-02-23 04:22:07 +0000
commitcd258079d02e056065c52de7fe0c7aa8bcef77de (patch)
treee3eadbd4fe5ebbb2c6f0048155adcfc2a8b0536a
parentdd8353a6d390c4985c2748d9b4db136347c85a3b (diff)
Set the correct when value for the public view of groups; reset when no longer a group.
Bug: 326348484 Test: atest SystemUITests Flag: NONE Change-Id: Ida7330fdb32466edf1eedc376f46deb67ac50758
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java8
2 files changed, 14 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index d828ad70f5c4..decb244947ff 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -849,6 +849,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
public void setNotificationGroupWhen(long whenMillis) {
if (mIsSummaryWithChildren) {
mChildrenContainer.setNotificationGroupWhen(whenMillis);
+ mPublicLayout.setNotificationWhen(whenMillis);
} else {
Log.w(TAG, "setNotificationGroupWhen( whenMillis: " + whenMillis + ")"
+ " mIsSummaryWithChildren: false"
@@ -2704,6 +2705,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
}
private void onAttachedChildrenCountChanged() {
+ final boolean wasSummary = mIsSummaryWithChildren;
mIsSummaryWithChildren = mChildrenContainer != null
&& mChildrenContainer.getNotificationChildCount() > 0;
if (mIsSummaryWithChildren) {
@@ -2714,6 +2716,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
isConversation());
}
}
+ if (!mIsSummaryWithChildren && wasSummary) {
+ // Reset the 'when' once the row stops being a summary
+ mPublicLayout.setNotificationWhen(mEntry.getSbn().getNotification().when);
+ }
getShowingLayout().updateBackgroundColor(false /* animate */);
mPrivateLayout.updateExpandButtons(isExpandable());
updateChildrenAppearance();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
index 402ea51bebb6..374248252d1f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
@@ -59,6 +59,7 @@ import com.android.systemui.statusbar.notification.collection.render.GroupMember
import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier;
import com.android.systemui.statusbar.notification.row.shared.AsyncHybridViewInflation;
import com.android.systemui.statusbar.notification.row.wrapper.NotificationCustomViewWrapper;
+import com.android.systemui.statusbar.notification.row.wrapper.NotificationHeaderViewWrapper;
import com.android.systemui.statusbar.notification.row.wrapper.NotificationViewWrapper;
import com.android.systemui.statusbar.policy.InflatedSmartReplyState;
import com.android.systemui.statusbar.policy.InflatedSmartReplyViewHolder;
@@ -2314,6 +2315,13 @@ public class NotificationContentView extends FrameLayout implements Notification
return false;
}
+ public void setNotificationWhen(long whenMillis) {
+ NotificationViewWrapper wrapper = getNotificationViewWrapper();
+ if (wrapper instanceof NotificationHeaderViewWrapper headerViewWrapper) {
+ headerViewWrapper.setNotificationWhen(whenMillis);
+ }
+ }
+
private static class RemoteInputViewData {
@Nullable RemoteInputView mView;
@Nullable RemoteInputViewController mController;