summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yining Liu <liuyining@google.com> 2023-06-12 22:12:50 +0000
committer Yining Liu <liuyining@google.com> 2023-06-21 17:56:34 +0000
commit2567cf9ed1c0720ae608424e116ee76bad2e1576 (patch)
tree6c8a32a8b1363f9b4e88176895f09f25c2a24815
parentdaed95816adaa5164b3ff49cd61df55f6ee20a80 (diff)
Add logs for group child notification row transient views removal
Add logs when group child notifications' row transient views are removed through removeFromTransientContainer from NotificationChildrenContainer and NSSL. Bug: 281628358 Test: `adb shell settings put global systemui/buffer/NotifRenderLog VERBOSE` and look for NotifRow in logcat Change-Id: Id27cd7896573fbeb0a87ad04eb9af4a6e8d8dacf
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java67
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java23
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt50
3 files changed, 139 insertions, 1 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 0bfd3c3c0b2b..ea6c31def0f2 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
@@ -53,6 +53,7 @@ import android.view.MotionEvent;
import android.view.NotificationHeaderView;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewParent;
import android.view.ViewStub;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -103,6 +104,7 @@ import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
import com.android.systemui.statusbar.notification.stack.NotificationChildrenContainer;
+import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.SwipeableView;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -1627,6 +1629,32 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
NotificationEntry child,
NotificationEntry newParent
);
+
+ /**
+ * Called when an ExpandableNotificationRow transient view is removed from the
+ * NotificationChildrenContainer
+ */
+ void logRemoveTransientFromContainer(
+ NotificationEntry childEntry,
+ NotificationEntry containerEntry
+ );
+
+ /**
+ * Called when an ExpandableNotificationRow transient view is removed from the
+ * NotificationStackScrollLayout
+ */
+ void logRemoveTransientFromNssl(
+ NotificationEntry childEntry
+ );
+
+ /**
+ * Called when an ExpandableNotificationRow transient view is removed from a ViewGroup that
+ * is not NotificationChildrenContainer or NotificationStackScrollLayout
+ */
+ void logRemoveTransientFromViewGroup(
+ NotificationEntry childEntry,
+ ViewGroup containerView
+ );
}
/**
@@ -3714,4 +3742,43 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
public boolean getShowSnooze() {
return mShowSnooze;
}
+
+ @Override
+ public void removeFromTransientContainer() {
+ final ViewGroup transientContainer = getTransientContainer();
+ final ViewParent parent = getParent();
+ // Only log when there is real removal of transient views
+ if (transientContainer == null || transientContainer != parent) {
+ super.removeFromTransientContainer();
+ return;
+ }
+ logRemoveFromTransientContainer(transientContainer);
+ super.removeFromTransientContainer();
+ }
+
+ /**
+ * Log calls to removeFromTransientContainer when the container is NotificationChildrenContainer
+ * or NotificationStackScrollLayout.
+ */
+ public void logRemoveFromTransientContainer(ViewGroup transientContainer) {
+ if (mLogger == null) {
+ return;
+ }
+ if (transientContainer instanceof NotificationChildrenContainer) {
+ mLogger.logRemoveTransientFromContainer(
+ /* childEntry = */ getEntry(),
+ /* containerEntry = */ ((NotificationChildrenContainer) transientContainer)
+ .getContainingNotification().getEntry()
+ );
+ } else if (transientContainer instanceof NotificationStackScrollLayout) {
+ mLogger.logRemoveTransientFromNssl(
+ /* childEntry = */ getEntry()
+ );
+ } else {
+ mLogger.logRemoveTransientFromViewGroup(
+ /* childEntry = */ getEntry(),
+ /* containerView = */ transientContainer
+ );
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
index 1acc9f90b58f..a03d5ae087ef 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
@@ -125,6 +125,29 @@ public class ExpandableNotificationRowController implements NotifViewController
) {
mLogBufferLogger.logSkipAttachingKeepInParentChild(child, newParent);
}
+
+ @Override
+ public void logRemoveTransientFromContainer(
+ NotificationEntry childEntry,
+ NotificationEntry containerEntry
+ ) {
+ mLogBufferLogger.logRemoveTransientFromContainer(childEntry, containerEntry);
+ }
+
+ @Override
+ public void logRemoveTransientFromNssl(
+ NotificationEntry childEntry
+ ) {
+ mLogBufferLogger.logRemoveTransientFromNssl(childEntry);
+ }
+
+ @Override
+ public void logRemoveTransientFromViewGroup(
+ NotificationEntry childEntry,
+ ViewGroup containerView
+ ) {
+ mLogBufferLogger.logRemoveTransientFromViewGroup(childEntry, containerView);
+ }
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt
index c3dd92a51a91..efafb66f6ea2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowLogger.kt
@@ -17,14 +17,21 @@
package com.android.systemui.statusbar.notification.row
+import android.view.ViewGroup
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LogLevel
import com.android.systemui.log.dagger.NotificationLog
+import com.android.systemui.log.dagger.NotificationRenderLog
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.logKey
import javax.inject.Inject
-class NotificationRowLogger @Inject constructor(@NotificationLog private val buffer: LogBuffer) {
+class NotificationRowLogger
+@Inject
+constructor(
+ @NotificationLog private val buffer: LogBuffer,
+ @NotificationRenderLog private val notificationRenderBuffer: LogBuffer
+) {
fun logKeepInParentChildDetached(child: NotificationEntry, oldParent: NotificationEntry?) {
buffer.log(
TAG,
@@ -48,6 +55,47 @@ class NotificationRowLogger @Inject constructor(@NotificationLog private val buf
{ "Skipping to attach $str1 to $str2, because it still flagged to keep in parent" }
)
}
+
+ fun logRemoveTransientFromContainer(
+ childEntry: NotificationEntry,
+ containerEntry: NotificationEntry
+ ) {
+ notificationRenderBuffer.log(
+ TAG,
+ LogLevel.INFO,
+ {
+ str1 = childEntry.logKey
+ str2 = containerEntry.logKey
+ },
+ { "RemoveTransientRow from ChildrenContainer: childKey: $str1 -- containerKey: $str2" }
+ )
+ }
+
+ fun logRemoveTransientFromNssl(
+ childEntry: NotificationEntry,
+ ) {
+ notificationRenderBuffer.log(
+ TAG,
+ LogLevel.INFO,
+ { str1 = childEntry.logKey },
+ { "RemoveTransientRow from Nssl: childKey: $str1" }
+ )
+ }
+
+ fun logRemoveTransientFromViewGroup(
+ childEntry: NotificationEntry,
+ containerView: ViewGroup,
+ ) {
+ notificationRenderBuffer.log(
+ TAG,
+ LogLevel.WARNING,
+ {
+ str1 = childEntry.logKey
+ str2 = containerView.toString()
+ },
+ { "RemoveTransientRow from other ViewGroup: childKey: $str1 -- ViewGroup: $str2" }
+ )
+ }
}
private const val TAG = "NotifRow"